Course Test · University: first two years

Mathematical statistics: independent answers

Each answer here was worked out by hand, without RatMath, before the RatMath code was written. Where the arithmetic is long, the working says how it was checked.

  1. 1.Maximum likelihood: exponential
    The waiting times 2, 3, 1, 4, 5 come from an exponential distribution with rate λ\lambda. Find the maximum likelihood estimate of λ\lambda.
    Answer
    ℓ(λ)=nln⁡λ−λ∑xi\ell(\lambda) = n\ln\lambda - \lambda\sum x_i, so λ^=n/∑xi=5/15=13\hat\lambda = n/\sum x_i = 5/15 = \tfrac13.
  2. 2.Maximum likelihood: Poisson
    Counts 2, 0, 3, 1, 4 come from a Poisson distribution. Find the maximum likelihood estimate of its mean.
    Answer
    λ^=xˉ=10/5=2\hat\lambda = \bar x = 10/5 = 2.
  3. 3.Unbiased variance
    Find the sample variance s2s^2 (divisor n−1n-1) of 3, 5, 7, 9, 11.
    Answer
    Deviations −4,−2,0,2,4-4,-2,0,2,4; ∑=40\sum = 40; s2=40/4=10s^2 = 40/4 = 10.
  4. 4.Two-sample t test
    Group A: 12, 15, 11, 14, 13. Group B: 16, 18, 15, 17, 19. Test equal means with the pooled two-sample tt test. Give tt, the degrees of freedom and the two-sided pp-value.
    Answer
    xˉA=13\bar x_A = 13, xˉB=17\bar x_B = 17, both s2=2.5s^2 = 2.5, pooled sp2=2.5s_p^2 = 2.5. t=−4/2.5(2/5)=−4t = -4/\sqrt{2.5(2/5)} = -4, 8 df, p≈0.00395p \approx 0.00395.
  5. 5.Paired t test
    Blood pressure before: 200, 210, 190, 220, 205; after: 195, 200, 192, 210, 198. Test for a change with a paired tt test (two-sided).
    Answer
    Differences 5, 10, −2-2, 10, 7: dˉ=6\bar d = 6, sd=24.5s_d = \sqrt{24.5}. t=6/(24.5/5)≈2.7105t = 6/(\sqrt{24.5}/\sqrt5) \approx 2.7105, 4 df, p≈0.0535p \approx 0.0535: not significant at 5%.
  6. 6.Interval for a variance
    A sample of n=10n = 10 from a normal population has s2=4s^2 = 4. Give a 95% confidence interval for σ2\sigma^2.
    Answer
    (9⋅4χ0.975,92,9⋅4χ0.025,92)=(3619.023,362.7004)≈(1.8925,13.331)\left(\dfrac{9\cdot4}{\chi^2_{0.975,9}}, \dfrac{9\cdot4}{\chi^2_{0.025,9}}\right) = \left(\dfrac{36}{19.023}, \dfrac{36}{2.7004}\right) \approx (1.8925, 13.331).
  7. 7.One-way ANOVA
    Three groups: {4,5,6}\{4,5,6\}, {6,7,8}\{6,7,8\}, {9,10,11}\{9,10,11\}. Compute the ANOVA FF statistic and its pp-value.
    Answer
    Means 5, 7, 10, grand mean 22/322/3. SSB=3(499+19+649)=38SS_B = 3(\tfrac{49}{9} + \tfrac19 + \tfrac{64}{9}) = 38, SSW=6SS_W = 6. F=(38/2)/(6/6)=19F = (38/2)/(6/6) = 19 on (2, 6) df, p≈0.00254p \approx 0.00254.
  8. 8.Inference for a slope
    For x=1,…,5x = 1,\dots,5 and y=2,4,5,4,6y = 2, 4, 5, 4, 6, find the least-squares slope, its standard error, the tt statistic and the two-sided pp-value for H0:β1=0H_0: \beta_1 = 0.
    Answer
    b1=8/10=0.8b_1 = 8/10 = 0.8. SSE=2.4SSE = 2.4, s2=0.8s^2 = 0.8, SE=0.8/10≈0.28284SE = \sqrt{0.8/10} \approx 0.28284, t≈2.8284t \approx 2.8284, 3 df, p≈0.0663p \approx 0.0663.
  9. 9.Coefficient of determination
    For the same data, find R2R^2.
    Answer
    SST=5.2SST = 5.2, SSR=0.82⋅10=6.4SSR = 0.8^2\cdot10 = 6.4… more simply R2=1−SSE/SST=1−2.4/8.8=811R^2 = 1 - SSE/SST = 1 - 2.4/8.8 = \tfrac{8}{11}.
  10. 10.Multiple regression
    Fit y=b0+b1x1+b2x2y = b_0 + b_1x_1 + b_2x_2 to x1=1,2,3,4,5x_1 = 1,2,3,4,5, x2=2,1,4,3,5x_2 = 2,1,4,3,5, y=3,4,8,8,11y = 3,4,8,8,11.
    Answer
    Solving the normal equations XTXb=XTyX^TXb = X^Ty gives b=(310,43,56)b = (\tfrac3{10}, \tfrac43, \tfrac56).
  11. 11.Mann–Whitney test
    Compare {1.1,2.3,3.0}\{1.1, 2.3, 3.0\} with {3.5,4.1,5.2,6.0}\{3.5, 4.1, 5.2, 6.0\} by the Mann–Whitney (Wilcoxon rank-sum) test. Give UU and the exact two-sided pp-value.
    Answer
    Every value in the first sample is below every value in the second, so U=0U = 0. Only 1 of the (73)=35\binom73 = 35 arrangements is that extreme on each side: p=2/35≈0.0571p = 2/35 \approx 0.0571.
  12. 12.Sign test
    Of 10 paired differences, 9 are positive and 1 negative. Find the two-sided sign-test pp-value.
    Answer
    2 P(X≥9)=2⋅10+11024=221024=11512≈0.02152\,P(X \ge 9) = 2\cdot\dfrac{10 + 1}{1024} = \dfrac{22}{1024} = \dfrac{11}{512} \approx 0.0215.
  13. 13.Fisher's exact test
    Find the two-sided Fisher exact pp-value for the table (3113)\begin{pmatrix}3&1\\1&3\end{pmatrix}.
    Answer
    Hypergeometric probabilities for the top-left cell 0,…,40,\dots,4: 170,1670,3670,1670,170\tfrac1{70},\tfrac{16}{70},\tfrac{36}{70},\tfrac{16}{70},\tfrac1{70}. Tables at most as likely as the observed one: p=3470=1735p = \tfrac{34}{70} = \tfrac{17}{35}.
  14. 14.Power of a z test
    Test H0:μ=100H_0: \mu = 100 against μ>100\mu > 100 with σ=15\sigma = 15, n=25n = 25, α=0.05\alpha = 0.05. What is the power when the true mean is 106?
    Answer
    Reject when xˉ>100+1.645⋅3=104.935\bar x > 100 + 1.645\cdot3 = 104.935. Power =P(Z>(104.935−106)/3)=P(Z>−0.355)≈0.6388= P(Z > (104.935 - 106)/3) = P(Z > -0.355) \approx 0.6388.
  15. 15.Sample size
    How large a sample gives a margin of error of at most 3 percentage points for a proportion at 95% confidence (use p=0.5p = 0.5)?
    Answer
    n≥(1.96/0.03)2⋅0.25=1067.1n \ge (1.96/0.03)^2 \cdot 0.25 = 1067.1, so n=1068n = 1068.
  16. 16.Conjugate prior
    With a uniform Beta(1, 1) prior on a success probability, 7 successes are seen in 10 trials. Give the posterior and its mean.
    Answer
    Beta(8, 4), with mean 8/12=238/12 = \tfrac23.
  17. 17.Kolmogorov–Smirnov statistic
    Find the Kolmogorov–Smirnov statistic DD for the sample 0.1, 0.4, 0.7 against the uniform distribution on [0,1][0, 1].
    Answer
    Compare F(x)=xF(x) = x with the step function: at 0.1 the gaps are 0.1 and 0.233, at 0.4 they are 0.267 and 0.067, at 0.7 they are 0.3 and 0.033. D=0.3D = 0.3.
  18. 18.Spearman's rank correlation
    Find Spearman's ρ\rho for x=1,2,3,4,5x = 1,2,3,4,5 and y=2,1,4,3,5y = 2,1,4,3,5.
    Answer
    Rank differences −1,1,−1,1,0-1, 1, -1, 1, 0, ∑d2=4\sum d^2 = 4: ρ=1−6⋅45⋅24=0.8\rho = 1 - \dfrac{6\cdot4}{5\cdot24} = 0.8.
  19. 19.Kruskal–Wallis test
    Find the Kruskal–Wallis HH for {1,2,3}\{1,2,3\}, {4,5,6}\{4,5,6\}, {7,8,9}\{7,8,9\}.
    Answer
    Rank sums 6, 15, 24. H=129⋅10(36+225+5763)−3⋅10=12⋅27990−30=365H = \dfrac{12}{9\cdot10}\left(\dfrac{36 + 225 + 576}{3}\right) - 3\cdot10 = \dfrac{12\cdot279}{90} - 30 = \dfrac{36}{5}.
  20. 20.Difference of proportions
    In two samples of 100, 45 and 30 people agree. Give a 95% confidence interval for p1−p2p_1 - p_2.
    Answer
    0.15±1.960.45⋅0.55100+0.3⋅0.7100=0.15±1.96(0.06745)≈(0.0174,0.2826)0.15 \pm 1.96\sqrt{\tfrac{0.45\cdot0.55}{100} + \tfrac{0.3\cdot0.7}{100}} = 0.15 \pm 1.96(0.06745) \approx (0.0174, 0.2826).