* program to generate 100 samples, n=10, with normal distribution (mu=50, sigma=6) * Bert Kritzer, June 27, 2002 * Set Seed added October 28, 2002 * updated to Version 9.0, November 1, 2005 version 9.0 * clear everything in memory drop _all * set number of repetitions (100); each row will be one sample) * to change number of replications, reset the value of 100 below * to desired number set obs 100 * set random number seed * students should reset this to a random number chosen from * table B set seed 53 * get observations * to get different mean and standard deviation, reset 50 and 6 in * line below for new case1-case10: gen X = 50+6*invnorm(uniform()) * get mean for each replications (the rmean function computes the * mean across the variables given as arguments) * * to use less than 10 observations for each replication, change * case1-case10 TO case1-case__ * where __ is the number of observations you want to use egen mean=rmean(case1-case10) histogram mean, bin(12) xlabel(42(2)60) normal