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

st: Re: overlaying normal curve

From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   st: Re: overlaying normal curve
Date   Mon, 26 Apr 2004 20:25:19 -0500


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,

----- Original Message ----- 
From: "Richard Ittenbach" <[email protected]>
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:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index