# Unit 4 for R # 030521 prepared by C. Andy Tsao # Q1: Is it reasonable to assume X_1, ..., X_n iid N(mu, sigma)? # A: 1. Prior information, previous studies # 2. Cannot do much when n is small # 3. When n is large, some tools are helpful x<-rnorm(30,1,2) # generate 30 random samples from Normal with # mean=1, variance=4. par(mfrow=c(2,2)); # set up graphic configuration hist(x);boxplot(x);plot(density(x)); qqnorm(x);qqline(x); # Keep in mind what you expect to see if normality does hold # and what the main deviation is. # There are other more advanced methods and tests. Nonetheless, # graphical tools are always helpful and easy to make understood.