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
Convert date and time to Stata formatHi all, I would like to convert the following date and time format into Stata format, so that I can…
question on line chart outputHello, I created a twoway line chart but the output is too small and I'm not sure how to make it la…
Generate spatial weight matrix by using "spweight"Hi everybody, I am working on Emad A. Shehata's spatial command modules, but I got a trouble in cre…
Replace missing values in panel dataset by the mean, by pasting up, by pasting downHello, I have the following dataset: clear input year id value 1990 1 . 1991 1 . 1992 1 4 1993 1 . …
Tabs for multiple subgroups in one tableI am hoping to run tabs for by various subgroups (different job roles, in this instance). For my tw…
Subscribe to:
Post Comments (Atom)
0 Response to Cannot get options to work on graph twoway
Post a Comment