UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL - MAY 2005 EXAMINATIONS STA 248 H1S Duration - 3 hours Aids Allowed: Calculator LAST NAME: FIRST NAME: STUDENT NUMBER: There are 17 pages including this page. On the last page is a list of formulae that may be useful. Tables of the normal distribution can be found on page 14, the t distribution can be found on page 15, and the chi-square distribution can be found on page 16. Total marks: 85 1 2 3 4 5ab 5cd 5ef 6abcde 6fghi 7 8 1
1. (8 marks) The histograms below show the distributions of marks for the 188 students who wrote the STA 247 exam. The first histogram is constructed from the marks for question 9 (out of 10) and the second histogram is constructed from the total of the marks on all questions (out of 100). Histogram of Q9 Histogram of total Frequency 0 20 40 60 80 Frequency 0 10 20 30 40 50 0 2 4 6 8 10 Q9 0 20 40 60 80 total (a) Describe the shape of each of the two distributions of marks. (b) If you were to pick a single statistic to summarize the distribution for question 9 and another to summarize the distribution of the total, what would they be and why? (c) Suppose the marks for all 10 questions on the exam had distributions like that for question 9. (They don t, but pretend they do.) Ignoring the actual values on the horizontal axis and concentrating on shape only, would you be surprised if the shape of the distribution of the total was the shape shown above? Why or why not? 2
2. (6 marks) For X a random variable with a Poisson distribution, the probability mass function is P (X = x) = e µ µ x for x = 0, 1, 2,... x! and E(X) = µ and Var(X) = µ. Suppose x 1, x 2,..., x n are n observations from a Poisson distribution. (a) Find the maximum likelihood estimate for µ. (b) Is your answer to part (a) unbiased? Explain. 3
3. (8 marks) A sample of size 4 from a normal distribution with σ 2 = 16 (assumed known) is used to test H 0 : µ = 10 versus H a : µ = 13. Suppose that the test statistic used is the sample mean, X, and that we will reject H 0 in favour of H a if the observed value of X is greater than 12. (a) If H 0 is true, what is the distribution of X? (b) On the diagram below, shade the region whose area is α. density 0.00 0.05 0.10 0.15 0.20 5 10 15 x (c) On the diagram below, shade the region whose area is the power of the test H 0 : µ = 10 versus H a : µ = 13. density 0.00 0.05 0.10 0.15 0.20 5 10 15 x (d) Give one way to increase the power and describe how it will affect your sketch in (c). 4
4. (5 marks) Identify an appropriate parametric test for each of the following situations. You can assume that the assumptions of the test procedure are satisfied in each case. Your choices for this question are: 1 sample t-test 2 independent samples t-test paired t-test 1-way analysis of variance 2-way analysis of variance chi-square test (a) A recent lawsuit against the Ford automobile manufacturer suggested that tire failure was the cause of fatal accidents in their sport utility vehicles (SUVs) more often than in SUVs of other manufacturers. The cause of fatal accidents involving SUVs (in particular, whether they were tire related or not) and the manufacturers of the SUVs (in particular, Ford or another) were recorded and the data are the counts in each category. We d like to determine whether there is a relationship between cause of accident and manufacturer. (b) A doctor is interested in assessing whether or not there is a difference in blood pressure levels for populations of young women using birth control pills and young women not using birth control pills. A random sample of 50 young women in each population is collected and their blood pressures are measured. (c) A random sample of workers is taken from each of 3 factories and the number of overtime hours worked for each worker is recorded. The purpose of the study is to examine the relationship between factory and hours of overtime worked. (d) A chemist is evaluating a new method for determining the percentage content of an element in a sample. She obtains a specimen of known content and makes 10 measurements of the percentage content of the element. She wants to compare her measurements to the known content. (e) Researchers collected intelligence test scores on twins, one of whom was raised by the natural parents and one of whom was raised by foster parents. They are interested in knowing whether there is an advantage in resulting intelligence scores for children raised by their natural parents. 5
5. (24 marks) Fourteen volunteer males with high blood pressure were randomly assigned to one of two diets for four weeks: a fish oil diet and a regular oil diet. The data collected are the reductions in diastolic blood pressure from the beginning of the study to the end. Here is some R output giving some summary statistics and side-by-side boxplots for the change in blood pressure. mean(pressuredrop[dietoil=="fish"]) [1] 6.571429 mean(pressuredrop[dietoil=="regular"]) [1] -1.142857 sqrt(var(pressuredrop[dietoil=="fish"])) [1] 5.8554 sqrt(var(pressuredrop[dietoil=="regular"])) [1] 3.184785 5 0 5 10 FISH REGULAR (a) Describe and compare the distributions of blood pressure change for each of the two treatment groups. (b) Estimate the median of each group. Compare its value with the mean of each group. How is this comparison related to your answer to part (a)? 6
(c) Here is some more output from R for question 7. Two Sample t-test data: pressuredrop by dietoil t = 3.0621, df = 12, p-value = 0.009861 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 2.225174 13.203398 sample estimates: mean in group FISH mean in group REGULAR 6.571429-1.142857 The following 4 questions relate to the output above. i. Give the null and alternative hypotheses being tested. ii. Explain how the given confidence interval and p-value give the same conclusion. iii. What assumptions are being made in the testing procedure? (d) Since the measurements are the reductions in blood pressure for each man, it is of interest to know whether the mean reduction is zero for each group. For the regular oil diet group carry out a test to determine the evidence that the mean reduction for this group is different from zero. 7
(e) Here is some R code related to the reductions in blood pressure for the men in the regular oil diet group. Two different procedures are being carried out. # PROCEDURE 1 bootsamples <- matrix(sample(pressuredrop[dietoil=="regular"],7*1000, + replace=t),nrow=1000) bootmeans <- apply(bootsamples,1,mean) diff <- bootmeans - mean(bootmeans) diff <- sort(diff) llimit <- mean(pressuredrop[dietoil=="regular"]) - diff[975] ulimit <- mean(pressuredrop[dietoil=="regular"]) - diff[25] llimit [1] -3.240857 ulimit [1] 1.044857 # PROCEDURE 2 y <- pressuredrop[dietoil=="regular"] - mean(pressuredrop[dietoil=="regular"]) bootsamples <- matrix(sample(y,7*1000,replace=t),nrow=1000) bootmeans <- apply(bootsamples,1,mean) mean(pressuredrop[dietoil=="regular"]) [1] -1.142857 (sum(bootmeans 1.142857) + sum(bootmeans < -1.142857))/1000 [1] 0.341 Indicate clearly what the procedures are and what are the results. (f) Explain why the bootstrap samples are drawn from different data for the two procedures in part (e). 8
6. (17 marks) Suppose that three database servers compete for our business. Each purports to have the smallest mean response time, averaged over a query mix particular to our activity. We collect a number of response times (variable name: times) from each server (recorded in variable server as 1, 2 or 3). The following analysis was carried out using R. Questions begin on the next page. mean(times[server==1]) [1] 624.199 mean(times[server==2]) [1] 238.123 mean(times[server==3]) [1] 348.44 sqrt(var(times[server==1])) [1] 155.5974 sqrt(var(times[server==2])) [1] 194.0457 sqrt(var(times[server==3])) [1] 147.928 db.aov <- aov(times ~ server) summary(db.aov) Df Sum Sq Mean Sq F value Pr(F) server 2 790892 395446 14.166 6.213e-05 *** Residuals 27 753723 27916 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05. 0.1 db.aov$coef (Intercept) server2 server3 624.199-386.076-275.759 qqnorm(db.aov$resid) TukeyHSD(db.aov) Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = times ~ server) $server diff lwr upr 2-1 -386.076-571.33898-200.81302 3-1 -275.759-461.02198-90.49602 3-2 110.317-74.94598 295.57998 9
Normal Q-Q plot of the residuals: Normal Q Q Plot Sample Quantiles 200 100 0 100 200 300 2 1 0 1 2 Theoretical Quantiles (a) What are the null and alternative hypotheses being tested by the F test? (b) How many observations were there? (c) What is SS Tot? (d) What is the estimate of the error variance? (e) What assumptions are necessary to justify the F test? 10
(More questions for #8.) (f) What assumptions are assessed by the Normal Q-Q plot? What does the given plot (on the previous page) suggest? (g) Show how the mean response times for each server can be calculated from the db.aov$coef. (h) Suppose the residual for the 4th response time on server 2 is negative. What does this tell you about that response time as it relates to the other observations from that database server? (i) Tukey s procedure was carried out. What is its purpose and what conclusions can be drawn from it? 11
7. (9 marks) In a double-blind study, human subjects were randomly assigned to take either a placebo or vitamin C tablet daily during the winter. The purpose of the experiment was to determine whether or not taking vitamin C helps protect people from colds. The following data were collected: Cold No cold Total Placebo 62 26 88 Vitamin C 157 75 232 Total 219 101 320 (a) Is this an experiment or an observational study? Explain how you know. (b) The study is described as double-blind. What does this mean and why is it a good feature of a study? (c) Conduct an appropriate test to determine whether there is a significant difference in catching a cold between subjects who took vitamin C and those who took the placebo. 12
8. (8 marks) The following statements are false. Correct them. (When there is more than one sentence in the parts below, the correction should be made to the last sentence.) Trivial corrections (e.g. simply inserting the word not ) will receive no credit. (a) If a sample size is large, then the shape of a histogram of the sample will be approximately normal, even if the population distribution is not normal. (b) A 95% confidence interval for the mean weight of adult males is calculated from a random sample of 120 males and found to be (70, 100) kg. Thus 95% of adult males weigh between 70 and 100 kg. (c) A type I error occurs when the test statistic falls in the rejection region of the test. (d) An analysis of variance is carried out to test whether the means of two groups are equal. Of course, this analysis could also have been carried out with an appropriate t-test. The test statistic for the analysis of variance F -test is the same as the test statistic for this t-test. 13
14
15
16
Some Assorted Formulae If X Bin(n, p), E(X) = np and Var(X) = np(1 p). Some confidence intervals: σ x ± z α/2 n s x ± t n 1;α/2 n ˆp(1 ˆp) ˆp ± z α/2 n ( (n 1)s 2 (n 1)s 2 ) χ 2, n 1;α/2 χ 2 n 1;1 α/2 s 2 (y 1 y 2 ) ± t (df; α 2 ) 1 + s2 2 n 1 n 2 (y 1 y 2 ) ± t (n1 +n 2 2; α 2 ) s p 1 n 1 + 1 n 2 Some test statistics: z obs = z obs = x µ 0 σ/ n t obs = x µ 0 s/ n ˆp p 0 p0 (1 p 0 )/n t obs = (y 1 y 2 ) (µ 1 µ 2 ) s 2 1 n 1 + s2 2 n 2 t obs = (y 1 y 2 ) (µ 1 µ 2 ) s p 1 n 1 + 1 n 2 χ 2 obs = r i=1 j=1 c (O ij E ij ) 2 E ij Some analysis of variance formulae: a n i SS Tot = (y ij y ) 2 i=1 j=1 a SS Tr = n i (y i y ) 2 i=1 a n i SS E = (y ij y i ) 2 i=1 j=1 s p (y i y j ) ± q (a,dfe,α) n 17 Total pages 17 Total marks 85