When trying to depict two coefficients from one regression on separate axes with Ben Jann's superb coefplot (ssc install coefplot) command, the coefficient to be shown on the 2nd axis is correctly displayed, but its confidence interval is depicted on the 1st scale.
Can anyone explain how I get the CI displayed on the same (2nd) axis as the coefficient it belongs to? I couldn't find any option to change this - and imagine it should be the default, if not the only, option to plot the CI around the point estimate it belongs to.
I use the latest coefplot version with Stata 16.
Here is a minimum example to illustrate the problem:
results plot
webuse union, clear
eststo results: reg idcode i.union grade
coefplot (results, keep(1.union)) (results, keep(grade) xaxis(2))
In the line
coefplot (results, keep(1.union)) (results, keep(grade) xaxis(2))
you specify the option xaxis(2), but this is not a documented option of coefplot, although it is a valid option of twoway rspike which is called by coefplot. Apparently, if you use xaxis(2) something goes wrong with the communication between coefplot and rspike.
This works for me:
coefplot (results, keep(1.union)) (results, keep(grade) axis(2))
I'm trying to create something similar. Since this option is not built-in we need to write a program to tweak how coefplot works. I'm sharing the code from the user manual here: http://repec.sowi.unibe.ch/stata/coefplot/markers.html
capt program drop coefplot_mlbl
*! version 1.0.0 10jun2021 Ben Jann
program coefplot_mlbl, sclass
_parse comma plots 0 : 0
syntax [, MLabel(passthru) * ]
if `"`mlabel'"'=="" local mlabel mlabel(string(#b, "%5.2f") + " (" + string(#ll, "%5.2f") + "; " + string(#ul, "%5.2f") + ")")
preserve
qui coefplot `plots', `options' `mlabel' generate replace nodraw
sreturn clear
tempvar touse
qui gen byte `touse' = __at<.
mata: st_global("s(mlbl)", ///
invtokens((strofreal(st_data(.,"__at","`touse'")) :+ " " :+ ///
"`" :+ `"""' :+ st_sdata(.,"__mlbl","`touse'") :+ `"""' :+ "'")'))
sreturn local plots `"`plots'"'
sreturn local options `"`options'"'
end
capt program drop coefplot_ymlbl
*! version 1.0.0 10jun2021 Ben Jann
program coefplot_ymlbl
_parse comma plots 0 : 0
syntax [, MLabel(str asis) * ]
_parse comma mlspec mlopts : mlabel
local mlopts = substr(`"`mlopts'"', 2, .) // remove leading comma
if `"`mlspec'"'!="" local mlabel mlabel(`mlspec')
else local mlabel
coefplot_mlbl `plots', `options' `mlabel'
coefplot `plots', ///
yaxis(1 2) yscale(alt) yscale(axis(2) alt noline) ///
ylabel(none, axis(2)) yti("", axis(2)) ///
ymlabel(`s(mlbl)', axis(2) notick angle(0) `mlopts') `options'
end
coefplot_ymlbl D F, drop(_cons) xline(0)
However, the above program does not allow for the option 'bylabel'. I get a stata error saying "bylabel not allowed". I wanted to ask if there is a way to edit this code and include the bylabel option which is used to label subplots?
The Census Bureau gives the mathematical formula for calculating the margin of error for the American Community Survey, but doesn't include the SAS code for it. The formula is on page 24 of the documentation here: http://www2.census.gov/programs-surveys/acs/tech_docs/accuracy/ACS_Accuracy_of_Data_2014.pdf
Does anyone have the SAS code for the Margin of Error? It would have to incorporate all 80 pwgtp's.
Here is the relevant code. It uses a 90% confidence interval because that is what the Census Bureau uses for their published margins of error on American FactFinder. You can change the confidence interval at the beginning where '1.64537' is.
/* Margin of Error 90% confidence code*/
1.64537*(SQRT(.05*(SUM((SUM(t1.pwgtp1)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp2)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp3)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp4)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp5)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp6)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp7)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp8)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp9)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp10)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp11)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp12)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp13)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp14)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp15)-(SUM(t1.PWGTP)))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)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp55)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp56)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp57)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp58)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp59)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp60)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp61)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp62)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp63)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp64)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp65)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp66)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp67)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp68)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp69)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp70)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp71)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp72)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp73)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp74)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp75)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp76)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp77)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp78)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp79)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp80)-(SUM(t1.PWGTP)))**2)))))/ (SUM(t1.PWGTP))
FORMAT=PERCENT6.1 AS Plus_Minus_Percent
/* End of Margin of Error Code */
To see where this fits in to a query, here is the full code of a query with the margin of error code embedded.
/* Example program */
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_COMBINEDACS2013_SAS7BD(label="QUERY_FOR_combinedacs2013.sas7bdat") AS
SELECT /* SUM_of_PWGTP */
(SUM(t1.PWGTP)) FORMAT=Z5. AS SUM_of_PWGTP,
t1.SCHL,
1.64537*(SQRT(.05*(SUM((SUM(t1.pwgtp1)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp2)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp3)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp4)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp5)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp6)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp7)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp8)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp9)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp10)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp11)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp12)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp13)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp14)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp15)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp16)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp17)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp18)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp19)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp20)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp21)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp22)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp23)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp24)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp25)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp26)-(SUM(t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(t1.PWGTP)))**2,(SUM(t1.pwgtp57)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp58)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp59)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp60)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp61)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp62)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp63)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp64)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp65)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp66)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp67)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp68)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp69)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp70)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp71)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp72)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp73)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp74)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp75)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp76)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp77)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp78)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp79)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp80)-(SUM(t1.PWGTP)))**2))))
AS Margin_of_Error,
/* Plus_Minus */
(1.64537*(SQRT(.05*(SUM((SUM(t1.pwgtp1)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp2)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp3)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp4)-(SUM(t1.PWGTP)))**2,(SUM(t1.pw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1.pwgtp65)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp66)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp67)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp68)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp69)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp70)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp71)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp72)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp73)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp74)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp75)-(SUM(t1.PWGTP)))**2
,(SUM(t1.pwgtp76)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp77)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp78)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp79)-(SUM(t1.PWGTP)))**2,(SUM(t1.pwgtp80)-(SUM(t1.PWGTP)))**2)))))/ (SUM(t1.PWGTP))
FORMAT=PERCENT6.1 AS Plus_Minus_Percent
FROM EC100005.combinedacs2013 t1
GROUP BY t1.SCHL;
QUIT;
/* End example program */