I am trying to plot estimates from multiple models using coefplot. I need to group all the estimates (for each independent variable) in one model, and then plot the models side by side.
Here's my code:
local indnumber "23 31 42 52 54 61 62 71 92"
foreach x of local indnumber{
eststo r`x'_2: reg ln_hourwage i.sex i.treat_pub b1.educ i.treat_pub#b1.educ i.treat_pub#i.sex b1.educ#i.sex i.treat_pub#b1.educ#i.sex ///
i.statecensus i.statecensus#b2010.year b1.month Age AgeSq b4.race b0.ptft b0.sector b43.occupation if industry == `x', vce(cluster clustervar)
eststo m`x'_2: nlcom ///
(GPG_1: _b[1.sex]) (GPG_2: _b[1.sex]+_b[2.educ#1.sex]) (GPG_3: _b[1.sex]+_b[3.educ#1.sex]) (GPG_4: _b[1.sex]+_b[4.educ#1.sex]) ///
(Male_1: _b[1.treat_pub]) (Male_2: _b[1.treat_pub]+_b[1.treat_pub#2.educ]) ///
(Male_3: _b[1.treat_pub]+_b[1.treat_pub#3.educ]) (Male_4: _b[1.treat_pub]+_b[1.treat_pub#4.educ]) ///
(TGPG_1: _b[1.treat_pub#1.sex]) (TGPG_2: _b[1.treat_pub#1.sex]+_b[1.treat_pub#1.sex#2.educ]) ///
(TGPG_3: _b[1.treat_pub#1.sex]+_b[1.treat_pub#1.sex#3.educ]) (TGPG_4: _b[1.treat_pub#1.sex]+_b[1.treat_pub#1.sex#4.educ]), post
}
I need to plot the estimates Male_1 Male_2 Male_3 and Male_4 side-by-side (with some offset) for each of the industries (indicated by the NAICS category in indnumber). The four estimates would be grouped for each industry and all 9 industry estimates would be in the same graph. I also need to rename Male_* to different education groups, and label the industries.
Any help would be great.
Related Posts with Coefplot: Group covariates by model, and not model by covariates
Panel Data for Time-Series RegressionDear all, I hope someone could help me with my issue. Although I have gathered all my data to be el…
year and month formatHello, I created the month variable into Stata format from 201509 to 2015m9 using the command: Co…
how to figure out if we're running in console or GUI mode?Is there any variable which would tell us if we're running in "command line" (or console) mode vs gr…
Listing Characteristics of matched countriesHi, I am matching countries with their nearest neighbours (using the nnmatch command and a range of …
polychoricpca postestimation testsHello, I would like to estimate a ses index using polychoricpca command, but I am new to multivariat…
Subscribe to:
Post Comments (Atom)
0 Response to Coefplot: Group covariates by model, and not model by covariates
Post a Comment