Using https://stats.idre.ucla.edu/stat/data/hsbdemo, clear, I attempted to create an overlaid histogram. The code supplied on the site gave me 2 errors: / / / is not a twoway plot type and ( is not a valid command name. I rewrote the code as follows: twoway histogram write if female ==1, start(30) width(5) color(green) freq || histogram write if female ==0, start(30) width(5) color(yellow) freq and produced a beautiful plot.
But when I attempted to run the same code w/ my data, . twoway histogram write if UL_Indicator ==1, start(1) width(5) color(green) freq || histogram write if UL_Indicator ==2, start(1) width(5) color(yellow) freq, I got the message: variable write not found.
I cannot see any difference in the syntax of the code. Why would the word "write" not give an error one time and give an error another time?
Has anyone experienced this problem previously?
But when I attempted to run the same code w/ my data, . twoway histogram write if UL_Indicator ==1, start(1) width(5) color(green) freq || histogram write if UL_Indicator ==2, start(1) width(5) color(yellow) freq, I got the message: variable write not found.
I cannot see any difference in the syntax of the code. Why would the word "write" not give an error one time and give an error another time?
Has anyone experienced this problem previously?
Comment