Download Stat 141 Fall, 2007 Exam 3, December 12 Solutions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
Transcript
Stat 141
Fall, 2007
Exam 3, December 12
Solutions
Note from John:
It is clear that all of you struggled with this exam. In reading though the results, I see that both time and
content were factors. Students struggled with several questions that I thought would be readily answered.
In retrospect I see several ways that I could have better prepared you or improved the exam by shortening
it and rephrasing questions.
John Boik
Question 1 (10 points)
A. (2 points): The interaction plot is created in the same way as we have done before. First you create a
contingency table (see B) and then use it to sketch the plot. To determine the significance of the interaction,
you could have looked at the significance of the interaction term in either the aov or the linear model results.
In both cases, the statistic and the p-value were deleted, so you had to calculate at least the statistic. In
the case of the t-value, this is the estimate/SE (where the estimate and SE are read from the table) (see
page 561) and in the case of the F statistic this is the mean square/MS residuals (where mean square and
MS residuals are read from the table) (see page 479). Both statistics were high and so the p-values were low.
1
B. (2 points): The contingency table was completed by looking at the Tukey results. The Tukey test
compares all pairs of groups. See for example page 512 and class handouts. As with other two-sample tˆ α ,df SE.
tests, it calculates a statistic based on the difference between groups. Intervals are calculated as d±t
2
R gives you the differences under the “diff” column, but the values in this column were deleted. They are
easily calculated as the midpoint of the confidence interval and the intervals are given. You are also given
one entry (s:m) in the table. You know the differences between all groups, so filling in the table just requires
some addition and subtraction. For example, the interval for the difference s:m-f:e was (7.7, 34.5) and so the
midpoint is 21. Then 73-21=52. The correct number of mice was 20, which was calculated from the degrees
of freedom.
morning
evening
full
46.5
52.1
starving
73.19
48.7
C. (2 points): Box plots are created from the contingency table (or by just seeing from the Tukey results
that the SM group was different from all the others).
2
D. (2 points): The model for the linear equation is read right from the R results: Y = b0 + b1 SF + b2 M E +
b3 (SF )(M E), where b0 = 52, for example and is the coefficient for the intercept. To determine which of the
, where estimate and SE are read right from the R table
four p-values are less than 0.05, use t = estimate
SE
(see page 561). The yes/no for the p-values should be evident from the magnitude of the t-statistics. The
correct answers are:
t-value
14.5
-0.66
-1.1
4.2
p<0.05
yes
no
no
yes
E. (2 points): The null hypothesis for the F tests is that b1 = b2 = b3 = 0 (or that the normalized sum of
squares for a model with only an intercept is the same as that for the full model). The confidence interval is
calculated as b0 ± t α2 ,df SE, where b0 and SE are taken from the R table and t is about 2. (See page 549.)
Question 2 (6 points)
A. (2 points): Relative risk: risk=P(failure|pred1=1)/P(failure|pred1=0) = 0.111/0.419=0.265. The histogram for pred2 should have been a near-normal distribution centered at zero with min and max of about
(-3,3).
B. (2 points): The correct log odds: 0.48+0.35*pred1 + 0.21*pred2. The multiplicative change in odds:
exp(0.21)=1.23.
C. (2 points): Probability of failure: P(failure|prob1=0) = 1-P(success|prob1=0) = 1-exp(0.48+0.21)/(1+exp(0.48+0.21))
= 0.33. Odds ratio: 1/5.57 = 0.17, or pf1=1/9, pf0=13/21, odds ratio= pf1/pf0 = 0.17. Note: I asked the
question “How much greater are the odds...”, thinking of an odds ratio. So if you calculate a difference
instead, it was accepted.
3
Question 3 (6 points)
A. (2 points): The residuals have a funnel shape and there is no simple transformation that will fix this. All
the transformations we talked about were for transforming a curve into a straight line.
B. (2 points): The slope is about 0.5 and the intercept is about zero. That is, y hat = 0.5x. A plot of ŷ vs
residuals will have the same shape but the x axis will be different by a factor of 0.5.
C. (2 points): The x axis refers to quantiles of a standard normal curve. The y axis refers to residual values.
The points would be slightly more spread out along the x axis if a t-distribution were used, but the change
would not be large because there are so many data points.
Question 4 (6 points)
A. (4 points): The distribution can be split into 6 intervals (<0.025, 0.025 to 0.34, and 0.34 to 0 percent
on each tail).
have an expected distribution and so we can use the chi-square goodness of fit test.
P We now
i
Statistic= i OiE−E
.
See
the class handout of Nov 8 for an example with the Poisson distribution.
i
B. (2 points): The test statistic with twice as much data will be about twice as large. See the class handout
of Nov 8 for an example.
Question 5 (2 points)
Graph the SS total, SS regression, and SS residuals. See page 553. The value of ŷ at x̄ bar is ȳ bar (see page
530 and class notes), and the formula is ȳ= 1/n * sum (y).
Question 6 (2 points)
P(cancer|z) cannot be calculated. By design 100 cancer and 100 non-cancer subjects were enrolled.
4
Question 7 (2 points)
tˆ2 follows an F distribution. See class notes and for example page 480. It is also mentioned in other
locations in the book.
Question 8 (2 points)
For example:
test positive
test negative
total
cancer
700
300
1000
no cancer
200
800
1000
total
900
1100
2000
Specificity: 800/1000=0.8. PVN: 800/1100=0.72
Question 9 (4 points)
P(diag|x)= P(x|diag)P(diag)/P(x) = 0.5*0.1/0.1 = 0.5.
1 = 0.5*P(diag)/0.1, P(diag)= 0.2.
Question 10 (3 points)
Note: The first question was not as clear as it should have been. I should have also said, “when n is large”
to make it more clear. Hence the term “approximately” below. If you pointed this out, you received credit.
Because of the wording of the problem, I also accepted the definition of the type II error.
Power=1-P(type II error) = P(rejecting H0|Ha=true). When the alternative hypothesis is far from mu and
is true, its easy to reject H0 and the power is typically one. Imagine a standard normal distribution centered
at mu=0 and we use a null hypothesis Ho=1000. In our two-sided test Ha is that mu is not equal to 1000.
In this case we are sure to reject the null hypothesis. Power decreases as the (true) alternative hypothesis
gets closer to mu. In fact, it approaches alpha as Ha approaches mu, as we discussed in class. Xbar is
likely to be close to mu and we have H0:mu=xbar. So our alternative hypothesis is that mu is not equal to
xbar≈mu, which is saying that Ha is close to mu. So power is approximately alpha and P(type II error) is
approximately 1-alpha.
Alpha is picked by the user and is not a function of sample size.
The confidence interval for a mean is not affected by the null hypothesis. It is ŷ ± t α2 ,df SE.
Question 11 (4 points)
A typical t-test is used to make inferences on a population mean, not a sample mean.
The alternative hypothesis can be one-sided, not the null hypothesis.
There is a 95 percent probability that the interval will capture the population mean (the interval is the
random variable, not the population mean). Other alternative wordings were accepted.
Degrees of freedom should be 6.
I also accepted a few other creative answers that were correct.
5
Question 12 (2 points)
Continuity correction is important when a continuous random variable is used in the hypothesis test of a
discrete random variable.
If the number of samples is large, CC is not so important. Other reasonable answers were accepted.
Question 13 (2 points)
There are 5ˆ10 possible combinations. You are interested in one of them, so the probability is 1/5ˆ10 =
1.02E-07.
Question 14 (2 points)
Note: This question was not clear as worded. A better and more clear question would have been “What is
the prob of obtaining a nine with two dice where one dice is five?”.
To get a nine with one dice=5, the other will need to be 4. The probability of (5,4) or (4,5) is (1/6 * 1/6)
+ (1/6 * 1/6) = 2/36
I accepted any reasonable answer for the approach that you took. Also, because of the way the question was
phrased, if you only answered in terms of symbols, that was accepted.
Question 15 (2 points)
ANOVA assumes that the population standard deviations are the same for the two groups. The t-test by
default does not. The results will be the same if the two standard deviations are the same. See page 577.
6