Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: overlaying normal curve


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: overlaying normal curve
Date   Mon, 26 Apr 2004 20:25:19 -0500

Rick,

You can use the -twoway function- with -twoway histogram- to overlay a
normal curve.

For example,
Using the auto dataset, if you wanted a histogram of weight with the normal
density of only the foreign cars you could do the following:


. sysuse auto
(1978 Automobile Data)

. sum weigh if fore == 1

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
      weight |        22    2315.909    433.0035       1760       3420

. twoway histogram weight ||  function y=normden(x, 2316,433) , range(1760
3420) yvarlab("Normal density (foreign cars)")  xtitle("Weight (lbs.)")


Hope this helps,
Scott

----- Original Message ----- 
From: "Richard Ittenbach" <ittenbach@email.chop.edu>
To: <undisclosed-recipients:>
Sent: Monday, April 26, 2004 5:02 PM
Subject: st: overlaying normal curve


> i want to put a normal curve over my histogram but stata only seems to
center the curve over the center of my distribution.
>
> i woud like to center it over what is considered to be the national
population mean (and not my mean, which is much lower than the population
mean).  how can i shift the normal curve overlay to the right in my
histogram--we want to emphasize the heaviness of our tail?
>
> rick ittenbach
> children's hospital of philadelphia
>


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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   |   What's new   |   Site index