程序代写 Assignment 2

Assignment 2
1. ⋆⋆⋆⋆⋆ (Inference, Week 5) Prove that the P-value under the null hypothesis is uniformly dis- tributed in [0, 1].
Hint: consider the following parametric test:
(a) Data: the n observations x1 , x2 , . . . , xn are i.i.d. realizations of random variable X .

Copyright By PowCoder代写 加微信 powcoder

(b) Statistical model: the probability distribution of the X depends on parameter θ;
(c) Hypothesis: an assertion concerning θ, denoted H0 for the null H0 : θ = a, and H1 for the one-side alternative H1 : θ > a;
(d) Decision rule: compute the test statistic t from data. Under the null, t is a realization of the random variable T . The reported p-value is P(T ≥ t).
Note that the p-value is a function of t, which in turn is a random variable. Show that p-value ∼ Unif[0, 1] under H0.
2. ⋆⋆⋆⋆⋆ (SLR, Week 6) Prove the following results from the lecture slides. Use linear algebraic (matrix) properties; do not use entrywise calculation.
(a) 􏰉ni=1 ei = 0. (b) 􏰉ni=1 Xiei = 0.
(c) 􏰉ni=1 Yi = 􏰉ni=1 Yˆi. (d) 􏰉ni=1 Yˆiei = 0.
(e) The regression line always goes through (X ̄,Y ̄).
3. ⋆⋆⋆⋆⋆ (SLR, Week 6) An experimenter was interested in the relationship between temperature and heart rate in the common grass frog. The temperature was manipulated in 2-degree increments ranging from 2 to 18 C with heart rates recorded at each temperature in beats per minute. (A different, randomly selected, frog was used at each temperature.)
Temp(X): 2 4 6 8 10 12 14 16 18 Heartrate(Y): 5 11 10 13 22 23 30 28 32
Unless otherwise stated, use hand calculation with calculator for all parts of this problem.
(a) Use R to draw a scatter plot of heart rate versus temperature, superimposed by the least squares
fitted line. Comment on the plot.
(b) State the simple linear regression model of heart rate on temperature. Compute the least squares estimates of slope and intercept viewing heart rate as the response variable and temperature as the explanatory variable. Interpret the results in the context of the study.
(c) At temperature 9 C, estimate the population mean heart rate corresponding to this temperature. Interpret the results in the context of the study.
(d) At temperature −2 C, estimate the population mean heart rate corresponding to this temperature. Explain your conclusion.
(e) Provide a suitable estimate of the population error variance in the model. Interpret the results in the context of the study.

4. ⋆⋆⋆⋆⋆ (SLR, Week 7) Continue to work on the frog data in the previous problem. Let β0 and β1 denote the intercept and the slope in the simple linear regression model Yi = β0 + β1Xi + εi where εi ∼ iid N(0,σ2) for i = 1,2,…,n.
Unless otherwise stated, use hand calculation with calculator for all parts of this problem.
(a) Perform a T test for H0 : β1 = 0 vs HA : β1 ̸= 0 and construct a 95% confidence interval for β1.
(b) Perform a T test for H0 : β0 = 0 vs HA : β0 ̸= 0 and construct a 95% confidence interval for β0.
(c) Provide a 95% confidence interval for the error variance σ2.
(d) Provide an appropriate 95% estimation interval for the population mean heart rate at temperature
(e) Conduct a power analysis with significance level α = 0.05 for a future study where the test of interest will be H0 : β1 = 0 vs HA : β1 ̸= 0. Assume the same set of X = 2,4,…,16,18 and σ = 2.5. Provide the rejection region and use R to compute the power at β1 = ±1.0, ±1.5.
5. ⋆⋆⋆⋆⋆ (SLR, Week 7) Consider a regression version of the two-sample problem in which 􏰅β1 +β2xi +εi, i=1,…,n1,
Yi = β3 +β4xi +εi, i=n1 +1,…,n1 +n2 =n,
where ε1, . . . , εn i.i.d. from N(0, σ2). Derive a 1 − α confidence interval for β4 − β2, the difference
between the two regression slopes.
6. ⋆⋆⋆⋆⋆ (SLR, Week 7) We wish to measure the three angles β1, β2, and β3 as depicted in the diagram below.
Elementary geometry tells us β1 + β2 = β3. Suppose we have available measurements Y1, Y2, Y3 of β1, β2, β3, respectively. Due to measurement error, Y1 + Y2 might not be equal to Y3. Assume that
Yi ∼ N(βi,σ2), for i = 1,2,3, independently. Derive the least squares estimates βˆ1, βˆ2, and βˆ3 and an unbiased estimator σˆ2.
Reading: Chapters 2-3 in JF, Chapter 2 in RC. Chapter 14 in JR; Practice Problems 1-17, 21-24 in Chapter 14 of JR.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com