Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Re overlaying normal curves over multiple histograms


From   Jennifer Dent <JDent@sgul.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Re overlaying normal curves over multiple histograms
Date   Mon, 13 Aug 2012 17:37:38 +0100

Hello,

I am trying to overlay two histograms, both with normal distributions added. I am able to add a normal line to the first histogram, and to add a second histogram using addplot, but I am not able to add a second normal line. Is there a way to do this? I want the y-axis presented as percentage (or frequency) and not density and wonder if this is where my problem might be?

My code, along with the error, is given below:

clear
set obs 10000
gen WE = rnormal(123.5, 17)
sort WE
gen SA = rnormal(127.9, 17)
sort SA

histogram WE, percent normal addplot(histogram SA, percent normal)

error: option normal not allowed r(198)

Many thanks in advance,

Jennifer Dent
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index