| /*------------------------------------------------------------------------------ | |
| ******************************************************************************** | |
| * Lopez, Sautmann, Schaner; AEJ Applied | |
| ******************************************************************************** | |
| ** Install all Stata packages needed for replication. | |
| ** Based on: https://github.com/gslab-econ/template/blob/master/config/config_stata.do | |
| ------------------------------------------------------------------------------*/ | |
| clear all | |
| set more off | |
| program main | |
| * *** Add required packages from SSC to this list *** | |
| local ssc_packages "coefplot pdslasso estadd" | |
| * *** Add required packages from SSC to this list *** | |
| if !missing("`ssc_packages'") { | |
| foreach pkg in `ssc_packages' { | |
| * install using ssc, but avoid re-installing if already present | |
| capture which `pkg' | |
| if _rc == 111 { | |
| dis "Installing `pkg'" | |
| quietly ssc install `pkg', replace | |
| } | |
| } | |
| } | |
| * Install packages using net, but avoid re-installing if already present | |
| capture which grc1leg | |
| if _rc == 111 { | |
| quietly cap ado uninstall grc1leg | |
| quietly cap net install grc1leg, from("http://www.stata.com/users/vwiggins") | |
| } | |
| capture which st0085_2 | |
| if _rc == 111 { | |
| quietly cap ado uninstall st0085_2 | |
| quietly cap net install st0085_2, from("http://www.stata-journal.com/software/sj14-2") | |
| } | |
| capture which st0594 | |
| if _rc == 111 { | |
| quietly cap ado uninstall st0594 | |
| quietly cap net install st0594, from("http://www.stata-journal.com/software/sj20-1") | |
| } | |
| end | |
| main | |