Hi,
I am trying to create a table (example attached) using esttab command. I have run different specifications of the regression and also stored the estimates with different names but I don't know how to ensure that esttab uses the stored estimates I want. Additionally, the table has to be generated for 5 specifications of the variable and hence I have used a foreach loop. This is my Stata code:
use "${home}/pointonepctsampleE.dta"
gen logminwage =ln(minwage)
g post = year==2006
xi i.division*post, pre(_d)
global X "division i.sex age i.racesingd married i.citizen hieduc"
foreach j of numlist 50 75 100 125 150 {
cap drop underp`j'
g underp`j' = poverty<`j'
//Specification 1
qui areg underp`j' logminwage post , cluster(state) absorb(state)
eststo DID
//Specification 2
qui areg underp`j' logminwage $X post , cluster(state) absorb(state)
eststo DIDwithcontrols
//Specification 3
qui areg underp`j' logminwage _d* post , cluster(state) absorb(state)
eststo divisionspecific
//Specification 4
qui areg underp`j' logminwage $X _d* post , cluster(state) absorb(state)
eststo divisionspecificandcontrols
if `j'==50{
esttab using table1.tex, replace keep(logminwage _cons) label nodep nonotes se noeqlines noobs mtitles(" " " " " " " ") title(Minimum Wage Difference in Difference\label{auto}) b(4)
}
if `j'==150{
esttab using table1.tex, append keep(logminwage _cons) nodep nonum nonotes se noeqlines mlabels(none) collabels(none) label b(4)
}
else {
esttab using table1.tex, append keep(logminwage _cons) nodep nonum nonotes se noeqlines noobs mlabels(none) collabels(none) label b(4)
}
}
I am copying the compiled table that I am getting and the kind of table that I require (also attached). It seems the way I am using esttab with the foreach loop is erroneous - the table repeats values for poverty<50 and is also all over the place on the page. I am new to Stata and any help would be greatly appreciated.
Related Posts with Using esttab to create a table
meta forestplot: no subgroup titlesI'm running -meta forestplot- (which I like) on the attached data. I have two subgroups. By default …
Using splitvallabels + catplot without over optionDear all, When creating graphs I often use splitvallabels to break up longer labels on the y axis. …
Problem with ttesti: 'Est_A' found where number expectedHi, For the below data sample, my point estimates of interest are shown in Est_A and Est_B. Also, co…
If a Generated Regressor X is orthogonal to a non-generated regressor W, would the variance and tests on W be correct?Good morning, Professor Jeff Wooldridge or anybody else who knows the answer, or has encountered th…
Can you propose a graph on which I can compare a couple of Uniform distributions?Good morning, Nick Cox or anybody else with interests in graphing: Can you please propose a graph w…
Subscribe to:
Post Comments (Atom)
0 Response to Using esttab to create a table
Post a Comment