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
three-year moving sumDear Statalist I have a yearly dataset of chinses non-financial listed firms from (2010-2017), I wa…
Cleaning a string variable to create a numerical variableHi, I have station-level electric fuel price variable that is reported in different formats - per ho…
RDD with dependent variable as a percentageDear Stata Community After reading the FAQ to the end, I'll try it again, sorry for that. I use th…
DCC-GARCH model commandsDear Statalist, I am doing my dissertation now about the contagion between return prices: UK and US…
RDD with fractional dependent variableDear Stata Community I use the RDD STATA package provided by Calonico, Cattaneo and Titiunik (2015)…
Subscribe to:
Post Comments (Atom)
0 Response to Using esttab to create a table
Post a Comment