Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 73349

Running estimation within preserve/restore boundaries and store estimates with eststo

$
0
0
Hello Stata users,

I am analysing a panel dataset in which I need to use preserve and restore boundaries to identify subsamples of my dataset in order to be able to estimate fixed effect models. I would like to use the eststt/esttab commands to generate output tables, where each column would be the output generated within a particular preserve/restore boundary. My do file does like this:

*SUBSAMPLE 1
preserve
keep if zaocode==11
duplicates drop id2 time, force
xtset id2 time
eststo R1: xtreg l_yield l_area_share area_female female_head family_acre labour_acre org_acre inorg_acre maincrop soil_quality ///
l_rain erosion irrigation intercrop saving_group head_educ cooperative improved_seeds transport farm_size trees_plot crops_perplot ///
num_crop_plot num_crops_farm if zaocode==11 , fe vce(cluster hhid)
restore

*SUBSAMPLE 2
preserve
keep if zaocode==12
duplicates drop id2 time, force
xtset id2 time
eststo R2: xtreg l_yield l_area_share area_female female_head family_acre labour_acre org_acre inorg_acre maincrop soil_quality ///
l_rain erosion irrigation intercrop saving_group head_educ cooperative improved_seeds transport farm_size trees_plot crops_perplot ///
num_crop_plot num_crops_farm if zaocode==12 , fe vce(cluster hhid)
restore

etc...

Is there any possible way to retrieve the eststoR1 and eststoR2 after the data is restored? In other words, the stored estimates disappear once 'restore' is ran. This is logical of course, but I was wondering whether anyone had come up with a trick to preserve those estimates

Many thanks

Basile Boulay

Viewing all articles
Browse latest Browse all 73349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>