#5.16 q<-4;n<-355;alpha<-0.05 p<-c(.3,.33,.16,.07,.14) diag(sigma)<-p*(1-p) UCI<-p+sqrt(qchisq(1-alpha, q)*diag(sigma)/n) LCI<-p-sqrt(qchisq(1-alpha, q)*diag(sigma)/n The simultaneous 95% confidence intervals are p1: [0.22508365, 0.3749163] p2: [0.25312921, 0.4068708] p3: [0.10006692, 0.2199331] p4: [0.02828834, 0.1117117] p5: [0.08327426, 0.1967257] The simultaneous 95% confidence interval that allows a comparison of the Bank of Shorewood with Bank B is (-0.1596662, 0.0996662). Since the interval contains 0, there is no significant difference between them. #5.20 280 278 276 274 x2 282 284 a) 190 192 194 x1 196 198 From the plot, I found that c (190,275) lies inside the 95% confidence ellipse. So there is no evidence to reject the hypothesis that they are plausible values for the mean tail length and mean wing length for the female birds. b) Simultaneous 95% T2 intervals are: x1: (189.4217, 197.8227) x2: (274.2564, 285.2992) 95% Bonferroni intervals: x1: (189.8216, 197.4229) x2: (274.7819, 284.7736) T2 intervals are wider than the Bonferroni intervals, since the Bonferroni test is a conservative test. c) Q-Q plots: The result Shapiro-Wilk normality tests: X1 X2 Test statistics 0.9698 0.9813 p-value 0.2857 0.6726 From both Q-Q plots and Shapiro-Wilk tests, there are no evidences to reject the normality assumption for x1 and x2. The scatter diagram is 320 300 320 300 260 240 280 Wing length 260 240 280 170 180 190 170 180 190 200 210 220 210 220 Tail length 200 The chi-square plot of the ordered distances is: From the scatter diagram, I found that points can form an ellipse. The points on the chisquare plot can approximately form a line. So I think the bivariate normal distribution is a viable population model. #5.22 (I used the 25 observations; answers may vary if you use all the observations) It is obvious that observations 9 and 21 are outliers. After removing the outliers, we can see from Q-Q plots that each variable appears to be normally distributed. But each pair of variables are not apparently bivariate normal. b) The Bonferroni intervals: x1: (9.789733, 15.33027) x2: (5.777122, 10.54528) x3: (8.646243, 12.44256) The T2 intervals: x1: (9.159708, 15.96029) x2: (5.234926, 11.08747) x3: (8.214557, 12.87424) The T2 intervals are wider than the Bonferroni intervals. #6.17 word <- read.table(file = "http://www.public.iastate.edu/~maitra/stat501/datasets/word.dat", header = F) n<-nrow(word);q<-ncol(word) mx<-mean(word) S<-cov(word) C<-matrix(c(-1,-1,1,1,1,-1,1,-1,1,-1,-1,1),byrow=T,nrow=3) a) T2<-n*(t(C%*%mx))%*% solve(C%*%S%*%t(C)) %*% (C%*%mx) # The value for T2 is 135.8543. test<-(n-1)*(q-1)/(n-q+1)*qf(p=0.95,df1=q-1,df2=n-q+1) #T2>test. So we have significant evident to reject the null hypotheses that they have no treatment effects. b) LCI<-C%*%mx-sqrt(test/n* diag(C%*%S%*%t(C)) ) UCI<-C%*%mx+sqrt(test/n* diag(C%*%S%*%t(C)) ) CI<-cbind(LCI,UCI) dimnames(CI) <- list(c("format","type","interation"),c("LCI", "UCI")) LCI UCI format -411.56737 -186.83888 type 124.97937 280.36438 interation -75.05883 32.40258 Since 0 is included in the interval for the interaction, there is no significant evidence to proof the interaction effect. But there are significant evidence to proof the format effect and type effect. c) From b) there is no interaction effect so M model of numerical cognition is supported in this experiment. d) The chi-square Q-Q plot appears approximately a straight line except for the largest three points. The test statistic for the correlation test is r= 0.980392 and p-value=0.405. So there is no sufficient evidence to reject the multivariate normal assumption. #6.22 a) The value for T2 is 96.37322 and the p-value is less than 0.0001. We can reject the null hypothesis so there are significant gender differences. The linear combination most responsible for the rejecting is (-95.600, 6.145, 5.737, -0.762). b) The 95% simultaneous confidence intervals: X1: ( -0.002523361, 0.1697234) X2: (-1.163483457, 1.4650835) X3: (0.868742824, 1.8760572) X4: (5.387340281, 17.1438597) The Bonferroni intervals: X1: (0.01621484, 0.1509852) X2: (-0.87752962, 1.1791296) X3: (0.97832550, 1.7664745) X4: (6.66629645, 15.8649035) Again, the Bonferroni intervals are narrower. c) The data were collected from graduate-student volunteers and thus they do not represent a random sample. So the sample is not representative for the whole population. So the inference from this study cannot be generalized to a larger population.