I'm using the following code to produce a bar chart with confidence intervals. If I drop the options, Stata produces the graph.
If I leave the options in, as shown below, I get the response: "option xlabel not allowed". Doesn't matter what option I put first--I'll get an error for it.
Seems clear there's a coding error, but I cannot figure out what it is.
collapse (mean) meanage=agefrstmar (sd) sdage=agefrstmar (count) n=agefrstmar if age20_35==1 [aw=perweight], by(sample)
generate upper_CI=meanage + invttail(n-1,0.025)*(sdage / sqrt(n))
generate lower_CI=meanage - invttail(n-1,0.025)*(sdage / sqrt(n))
graph twoway (bar meanage sample)(rcap upper_CI lower_CI sample), ///
xlabel 64601 "1992" 64602 "2000" 64603 "2005"64604 "2010" 64606 "2014"
title "Mean Age at First Marriage"
Thanks for any help.
Related Posts with Cannot get options to work on graph twoway
Within Estimator StataI have a set of panel data showing Unemployment in NI & ROI pre brexit in 2015 and post brexit i…
Graph dummy variableDear users Hope you are doing well. I have a panel data. My Dep is dummy (0, 1), and I have a dummy …
Cumulative frequency of unique values within groupsHello statalist, My dataset is an unbalanced time series (with repeated years). Each company can ha…
Interpretation of coefficientsDear Statalist, I would like to know how to interpret the results of a regression that I'm running.…
Changing Axis Range - Pre Saved .gphHi Im having an issue with a pre saved graph. I would like to change the range of mye y-axis. Someon…
Subscribe to:
Post Comments (Atom)
0 Response to Cannot get options to work on graph twoway
Post a Comment