* Example 5.3.1 * Generate population clear set obs 5 gen x = (_n+2)*2 gen Freq = 1 gen Frac = 1/5 list twoway (bar Freq x, sort fintensity(10) ylabel(#6)), ytitle(Freq (x)) yscale(range(0 6)) xtitle(Distribution of population) twoway (bar Frac x, sort fintensity(10) ylabel(#2)), ytitle(Relative Freq (x)) yscale(range(0 0.2)) xtitle(Distribution of population) summarize x, detail * Generate sampling distribution of sample mean clear set obs 25 gen s1 = ceil(_n/5) gen s2 = mod(_n, 5) replace s2=5 if s2==0 gen x1=(s1+2)*2 gen x2=(s2+2)*2 gen xMean = 0.5*(x1+x2) summarize xMean, detail * Generate the histogram for frequency histogram xMean, discrete color(blue) fintensity(inten10) freq xlabel(#9) xtitle(Sampling distribution of sample mean) yscale(range(0 6)) ylabel(#6) * Generate the histogram for density histogram xMean, discrete color(blue) fintensity(inten10) dens xlabel(#9) xtitle(Sampling distribution of sample mean) * Calculate the frequency, relative frequency and cumulative frequency in percentage for sample mean tabulate xMean