[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: histogram with normal distribution modified

From   Maarten buis <>
Subject   Re: st: histogram with normal distribution modified
Date   Sun, 9 Mar 2008 20:09:10 +0000 (GMT)

--- Ana Gabriela Guerrero Serdan <> wrote:
> I'm doing a histogram of z-scores. My distribution is 
> skewed to the left median is on -1. I would like to
> show the histogram and a normal distribution but the
> normal distribution going from the mean value 0 not
> from the median -1. 
> How can move the normal distribution? 

1) You don't have to move the normal distribution, it
is already centered around the mean:

*---------- begin example ---------
drop _all
set obs 1000
gen x = exp(invnormal(uniform()))
sum x 
replace x = (x-r(mean))/r(sd)
hist x, norm
*----------- end example -----------

2) Comparing the hight of the histrogram bars to a 
curve is a bad way of finding patterns in the 
deviations from the Gaussian distribution. 
Alternatives are Nick Cox's -dpplot- and mine 
-hangroot-. See: -ssc desc dpplot- and 
-ssc desc hangroot-.

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Sent from Yahoo! Mail.
The World's Favourite Email
*   For searches and help try:

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