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
Create a new variable based on a date string variable yyyy-mm-dd and a numeric variable (yyyymmdd)Hi! I am very new to STATA. I have seen you answer different questions regarding date-variables. Ho…
MFX table logit commandHi all, I'm fairly new to Stata since I need it to write my bachelor thesis. However I'm stuck... I…
Setting version, seed, and sortseed not sufficient for reproducibility?The following code appears to produce different results depending on the Stata 16.1 edition I use. …
time series regressions for a portfolioDear all For a project we have to use performance regression to estimate whether a portfolio delive…
Clogit vs Xtlogit with FE vs Logit with Dummy VariablesHi, I have an unbalanced panel data of stocks with N=20,000 and T=50 years. I have 50 industries. I…
Subscribe to:
Post Comments (Atom)
0 Response to Using esttab to create a table
Post a Comment