Math 329 Mathematical Statistics Solutions to Exam 1 review

Math 329 Mathematical Statistics
Solutions to Exam 1 review problems
Note: These are partial solutions to the exam review problems. In some cases I did not
write out all the steps. On the exam you are expected to show all work.
1. A sample poll of 100 voters chosen at random from all voters in a given district indicated
that 55% of them were in favor of a particular candidate. Find (a) 95%, (b) 99%, (c)
99.73% confidence limits for the proportion of all the voters in favor of this candidate.
Solution: (a) We have a fairly large sample size of n = 100 and the sample proportion
p̂ = 0.55 is not too close to 0 or 1, so it is reasonable to use a normal approximation
of the sampling distribution of p̂. The approximate 95% CI is
r
r
r
p(1 − p)
p̂(1 − p̂)
(0.55)(0.45)
≈ p̂±1.96
= 0.55±
= 0.55±0.10
p̂±1.96 SE(p̂) = p̂±1.96
n
n
100
or (0.45, 0.65).
(b) Similar to (a), but use 2.58 instead of 1.96. The approximate CI is 0.55 ± 0.13
(c) Similar to (a), but use 3 instead of 1.96. The approximate CI is 0.55 ± 0.15
2. In a random sample of 400 adults and 600 teenagers who watched a certain TV program, 100 adults and 300 teenagers indicated that they liked it. Construct (a) 95%, (b)
99% confidence limits for the difference in proportions of all adults and all teenagers
who watched the program and liked it. (c) Do a hypothesis test to see if there is statistically significant evidence at the α = 0.01 level that the two proportions are different.
What assumptions did you make? (d) Compute the p-value for the hypothesis test.
Solution: Let p1 be the true proportion of teenagers in the population who liked the
program, and let p2 be the proportion of adults who liked the program. We use sample
proportions p̂1 = 300/600 = 0.5 and p̂2 = 100/400 = 0.25 to estimate p1 and p2 . We
have large sample sizes and the estimated proportions are not too close to 0 and 1, so
we will a normal-based approximate CIs.
(a) The approximate 95% CI is
s
p̂1 − p̂2 ± 1.96
p̂1 (1 − p̂1 ) p̂2 (1 − p̂2 )
+
= 0.25 ± 0.06
n1
n2
(b) Similarly the approximate 99% CI is 0.25 ± 0.08.
(c) Test H0 : p1 − p2 = 0 vs Ha : p1 − p2 6= 0.
1
Use the test statistic
p̂1 − p̂2
Z=r
p̂(1 − p̂) n11 +
1
n2
where p̂ = (300 + 100)/(600 + 400) = 0.4. This Z statistic has approximate normal
distribution for large sample sizes, which is the case in this exercise. The rejection
region is R = (−∞, 2.58) ∪ (2.58, ∞) and the value of the test statistic is Z = 7.9,
which is in R. Therefore we reject H0 .
(d) The p-value is the probability of observing a test statistic value at least as extreme
as 7.9 if H0 were true. It is P (Z ≥ 7.9 or Z ≤ −7.9 if H0 is true) = 2pnorm(-7.9) ≈ 0.
As an exercise, do the one-sided test H0 : p1 − p2 = 0 vs Ha : p1 − p2 > 0.
3. A population has a density function given by
(
(k + 1)xk
f (x) =
0
0≤x≤1
otherwise
For a random sample X1 , . . . , Xn from this population, find the maximum likelihood
estimate and the method of moments estimate of k.
Solution: The likelihood function is L(k) = (k + 1)n (x1 · · · xn )k and the log-likelihood
is `(k) = n log(k + 1) + k log(x1 · · · xn ). Set the derivative to 0 and solve for k: 0 =
`0 (k) = n/(k+1)+log(x1 · · · xn ) =⇒ k = −1−n/ log(x1 · · · xn ). The second derivative
is `00 (k) = −n/(k + 1)2 < 0, so we know we have found a maximum. Thus the MLE is
b
kMLE = −1 − n/ log(x1 · · · xn ).
R1
To find the MOM estimator, first compute the expected value E(X) = 0 x (k +
1)xk dx = (k + 1)/(k + 2). Setting X̄ = (k + 1)/(k + 2) and solving for k, we find that
the MOM estimator is b
kMOM = (1 − 2X̄)/(X̄ − 1)
4. A population consists of the five number 2, 3, 6, 8, 11. Consider all possible samples of
size two which can be drawn with replacement from this population. Find (a) the
mean of the population, (b) the standard deviation of the population, (c) the mean
of the sampling distribution of means, (d) the standard deviation of the sampling
distribution of means.
Solution: (a) The population mean is just the average fo the five numbers: µ = 6.0.
(b) The variance is the average squared distance of the population from the mean:
2
2 +··· )
= 10.8. The standard deviation is σ = 3.29.
σ 2 = (2−6) +(3−6)
5
2
(c) There are 5 = 25 samples of size two; here are a few of the samples: (2, 2), (2, 3),
2
(3, 2), (2, 6), (6, 2), . . . . Their corresponding means are 2, 2.5, 2.5, 4, 4, . . . , and the
mean of the sampling distribution of means is
µX̄ =
sum of all 25 sample means
= 6.0
25
illustrating the fact that µ = µX̄ for sampling with or without replacement.
2
(d) The variance of the sampling distribution, σX̄
, is the average squared distance
2
between µX̄ and the 25 sample means. We have σX̄
= 135/25 = 5.4 and σX̄ =
2.32. These results illustrate the fact that for sampling with replacement in finite
2
populations (or infinite populations), σX̄
= σ 2 /n, with n = 2 in this case.
5. Repeat the previous problem, but assume the samples are drawn without replacement.
Solution: (a) Same answer as part (a) of previous problem.
(b) Same answer as part (b) of previous problem.
(c) There are 20 = (5)(4) samples of size two which can be drawn without replacement
(in the textbook’s notation, each sample is written as xI(1) , xI(2) ), for example (2, 3),
(3, 2), (2, 6), (6, 2), (2, 8), (8, 2), . . . . The mean of the sampling distribution of means
is
sum of all 20 sample means
= 6.0
µX̄ =
20
illustrating the fact that µX̄ = µ for sampling with or without replacement.
(d) The variance of the sampling distribution of means is
(2.5 − 6)2 + (2.5 − 6)2 + (4 − 6)2 + · · ·
=
= 4.05
20
2
−n
5−2
2
= σn N
This illustrates σX̄
, since 10.8
= 4.05.
N −1
2
5−1
2
σX̄
6. A team of researchers plans a study to see if a certain drug can increase the speed
at which mice move through a maze. An average decrease of 2 seconds through the
maze would be considered effective, so the researchers would like to have a good chance
of detecting a decrease this large or larger. Assume the standard deviation is σ = 3
seconds and that the researchers will use a significance level of α = 0.05. Let µ be the
true mean decrease in time through the maze. The researchers are testing H0 : µ = 0
versus Ha : µ > 0. Do you think 20 mice would be a large enough sample size
for this study if the researchers want to detect a change of 2 seconds (i.e.,
they want to be reasonably sure that H0 is rejected if there is a change of 2
seconds)? To answer this question, do a power calculation. [Optional question: How
many mice should the researchers test to ensure that there is at least a 95% probability
of rejecting H0 when there is a true 2 second decrease.]
3
√
Solution: Using the test statistic (X̄ − 0)/(3/ 20) the rejection region is R =
(1.645, ∞). Calculate the power of the test when µ = 2:
X̄ − 0
√ ≥ 1.645 when µ = 2)
3/ 20
X̄ − 2
2−0
2−0
= P ( √ + √ ≥ 1.645 when µ = 2) = P (Z + √ ≥ 1.645)
3/ 20 3/ 20
3/ 20
= 1 − 1-pnorm(1.645-2/(3/sqrt(20))) = 0.91
1 − β(2) = P (reject H0 when µ = 2) = P (
With a sample size of 20, the researchers have a 91% chance of correctly concluding
that the drug is effective if the true average decrease in time is 2 seconds. Thus 20
mice is probably enough.
For the optional question, solve for n when P (Z +
is n = 25 (rounded up).
2−0
√
3/ n
≥ 1.645) = 0.95. The answer
3
6
Normal Q−Q Plot
0
Sample Quantiles
7. Following is a normal quantile plot of 100 observations from an unknown distribution.
Give a rough sketch of the density function of this distribution. How do its left and
right tails compare with those of the normal distribution?
−2
−1
0
1
2
Theoretical Quantiles
0
1
2
3
4
5
6
0.20
0.00
density
0.4
0.1
density
Solution: Here are two possible shapes of the unknown density function:
0
x
1
2
3
x
4
4
5
6
The main features are: (1) The density is zero for negative x values (this is because
the normal quantile plot does not include negative y values). (2) The left tail of the
unknown distribution is shorter/lighter than that of the normal distribution. (3) The
right tail of the unknown distribution is comparable to, or slightly longer/heavier than,
that of the normal distribution.
Further explanation: The normal quantile plot is concave up until about 0, and after
that is appears close to linear, or perhaps slightly concave up. The initial upward
concavity means the area under the left side of the unknown density curve is accumlating slower than area under the left side of the normal curve. For example, if z·
denotes the normal quantiles, then the first three points on the normal quantile plot
are (z.01 , y1 ), (z.02 , y2 ), (z.03 , y3 ) where y1 , y2 , and y3 denote the smallest three observations from the unknown distribution, with y1 ≤ y2 ≤ y3 . Upward convexity means
that (y3 − y2 )/(y2 − y1 ) > (z.03 − z.02 )/(z.02 − z.01 ). In general in a sample of size
100 we expect yi ≈ qi/100 where qp denotes the p quantile of the unknown distribution. Thus upward convexity at the first three data points can be characterized as
(q.03 − q.02 )/(q.02 − q.01 ) > (z.03 − z.02 )/(z.02 − z.01 ). As the next figure illustrate, we
would expect this inequality hold when the unknown distribution has a shorter-thannormal tail on the left.
5
8. Let X1 , . . . , Xn be a random sample from a Bernoulli(p) distribution. We know that
the variance of a Bernoulli(p) distribution is σ 2 = p(1−p). We don’t know p and would
like to estimate σ 2 from the data. Because we usually use X to estimate p, a possible
estimator for σ 2 is σb2 = X(1 − X). (a) Compute the expected value of the estimator
σb2 . (b) Use a first order Taylor series expansion to approximate the variance of this
estimator.
Solution: (a) Using the fact that E(X̄) = µX̄ = µXi = p, we have
p(1 − p) 2
+p ) = p(1−p)
E(σb2 ) = E(X̄−X̄ 2 ) = E(X̄)−E(X̄ 2 ) = p−(Var(X̄)+E(X̄)2 ) = p−(
n
This shows that X̄(1 − X̄) is a biased estimator of σ 2 : its expected value is not exactly
equal to σ 2 = p(1 − p), but it is very close, especially for large n.
6
n−1
n
(b) Taking the variance of the first order Taylor approximation of X̄(1 − X̄), centered
around p, gives the approximation Var(X̄(1 − X̄)) ≈ Var(p(1 − p) + (1 − 2p)(X̄ − p)) =
(1 − 2p)2 Var(X̄) = (1 − 2p)2 p(1 − p)/n.
9. How many outliers would we expect in a sample of size 100 from an exponential distribution with rate λ = 1?
Solution: The 25% and 75% quantiles for the Exponential(λ = 1) distribution are
qexp(.25,rate=1) = 0.29 and qexp(.75,rate=1) = 1.39. So IQR = 1.39 − 0.29 =
1.10. the probability of observing an outlier is P (X > 1.39 + 1.5 ∗ IQR) + P (X <
0.29 − 1.5 ∗ IQR) = 0.05. We expect 5 outliers in a sample of 100.
7