Dear Statalisters,
I am trying to find a way to transfer only the mean and standard error (not the entire content) from a log file into an Excel file. I tried the putexcel function but I do not find a way for this to work when my codes include locals and a foreach command. For example:
Thanks in advance.
Kind regards,
Eline
I am trying to find a way to transfer only the mean and standard error (not the entire content) from a log file into an Excel file. I tried the putexcel function but I do not find a way for this to work when my codes include locals and a foreach command. For example:
Does anyone know how to do this? Since I've got hundreds of tables within log files that include means and standard errors I'm interested in, it would save me lots of time (at the moment I'm just copy-pasting everything).Code:local personal "age agesq male ethnic_minority mnact_working eduyears_completed marit_married relig_* borncntry i.hincome urbanicity_city urbanicity_suburb i.year" local instrument "prosec_judge_exam_exper_index" local country "clearrate_crim_avg gdp avg_schooling15" local lawvar "judicial_pca3" local dishonesty "document2 claimbenef2 bribe2 scndhand2" foreach x in `dishonesty' { quietly reg `x' `lawvar' `country' `personal' own_home rooms_house [pweight=dweight], vce(cluster Agecountry) sum `x' [aweight=dweight] if e(sample) }
Thanks in advance.
Kind regards,
Eline
Comment