Reformatting command for histogram into do file

Reformatting command for histogram into do file

by Amy -
Number of replies: 2

I'm having a lot of trouble getting my do file to run a histogram. I made the histogram using the "Graphics" menu and I transferred the command over to my do file and it keeps saying: invalid 'start'. I have been rechecking the command and trying different ways to break up the lines but still unsuccessful. What am I doing wrong?

 

histogram AGE, frequency  ///
 ytitle(, size(large) margin(small)) ///
 ylabel(0(500)2000) ///
 xtitle(Patient age (Years)) ///
 xtitle(, size(large) margin(medium))xlabel(0(10)100) ///
(bin=44, start=0, width=2.2727273)

In reply to Amy

Re: Reformatting command for histogram into do file

by Linda Park -

Hi Amy,

Try taking out the last line with the "bin... start..." (and the /// on the line before that?). I had the same problem. Hope it works for you. 

 

Linda

In reply to Amy

Re: Reformatting command for histogram into do file

by Elizabeth Uy-Smith -

Hello Amy,

I agree with Linda. The (bin=44, start=0, width=2.2727273) portion is part of the Stata output when you use the drop-down menu. You don’t want to copy that portion into your .do file. 

Please let us know if you have more questions!

ellie