Generating Normal Data and Plotting Histograms
Normal draws and honest histograms
A standard normal draw Z becomes a draw from a requested normal model through X=μ+σZ, where μ is the mean and σ>0 is the standard deviation. A histogram then groups many generated values into intervals so that their shape can be inspected without mistaking one sample for the model itself.
Generate normal values
The transformation shifts by μ and scales deviations by σ; its resulting distribution has mean μ and standard deviation σ. If the specification gives variance, take its square root to find the scale before multiplying Z. A negative Z places a draw below the mean when σ is positive.
Generate multiple draws to form a sample. For a sample of one, its sample mean equals that draw; one draw alone cannot empirically establish the population mean or reveal the distribution's shape. A fixed seed can reproduce a particular pseudorandom run, but it does not guarantee that run is representative.
Construct and compare histograms
Choose and report the bin edges before interpreting bars. Under a half-open convention [a,b), a value exactly on a shared edge enters the bin to its right. Bins used to normalize a complete sample must cover every observation exactly once.
A count histogram uses the number of observations in each bin as its height. A density histogram uses count/(n×bin width); each bar's area is its observed proportion, and all areas sum to one when the bins cover the sample. Label the vertical scale, especially when comparing bins of different widths.
Worked example
Suppose μ=11, σ=3, and one standard-normal draw is Z=−1.2. The generated value is X=11+3(−1.2)=7.4. This value is below the mean, as its negative standard-normal score predicts.
For a separate hypothetical sample of ten values, suppose a width-two bin contains three values. Its density height is 3/(10×2)=0.15 per measurement unit, while its area is 0.15×2=0.30, the observed proportion 3/10. The count height for that same bin would be three.
A density histogram uses 100 observations and equal bins of width 2. One bin contains 20 observations. What height should that bin have?
Two independent samples of size 50 are generated from the same N(0,1) model, then plotted with identical histogram bins. Their bar heights differ. What is the best interpretation?