Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Biostatistics 650, Fall 2022: Homework #3

Problem 1

Continue with the dataset in Homework 2 (stroke study).  Recall that the main goal was to study various psychological factors: optimism, fatalism, depression, spirituality, and their relationship with stroke severity and other health outcomes among the study participants. Data were collected using questionnaires during a baseline interview and also medical chart review. More information about this study can be found in the article Fatalism, Optimism, Spirituality, Depressive Symptoms, and Stroke Outcome: A PopulationBased Analysis. Stroke, 42(12):3518-3523, 2011. The article can be downloaded on the course website.        The dataset that you will work with is called Completedata (the same dataset that you worked with for Homework 2).   The variables Optimism  (higher=more optimism), Fatalism  (higher=feels less control of their life), Depression (higher is more depressed), Spirituality (higher is more belief in a higher power) are variables generated from the observational study.  For our homework purposes we will assume they are continuous.  NIHScore is the NIH Stroke Severity score, with low numbers representing mild stroke, and larger number more severe stroke, and will also be assumed continuous.

1.  Analyze the association between Depression and Fatalism using simple linear regression.

(a)  Are Depression and Fatalism significantly associated?  Write out the formal hypothesis test:

fully state the null and alternative hypotheses, report the results of the test in statistical terms, and write out the conclusion in plain language, and supported with evidence (p-value).

(b)  Report and interpret the R-squared statistic (the coefficient of determination).

2.  Calculate the sample mean of depression for males and females separately, and calculate the difference between females and males (mean from females mean for males). Using a two-sample t-test, compare the differences in depression scores for females vs males:  Calculate the p-value:  1) assuming equal variances, 2) not assuming equal variances.  (can use t .test() in R or PROC  TTEST in SAS with the appropriate options to get the two results, no interpretation is needed, just list the p-values from both procedures).

3.  Fit a linear regression model with depression as the outcome and X = 0 for males and 1 for females as the predictor.  Compare the coefficient with the difference in sample means in question (ii) (same or different?).  Compare the p-value for X with the p-values for question (ii).  Does the p-value from regression equal the p-value from the two sample test 1) assuming equal variances, or 2) not assuming equal variances?

Problem 2

Consider the model

Yi  = β0 + β1 X1i + β2 X2i + ei , 

where i = 1, ...,n, and and the covariates have been centered at their means.

(a)  Set up the model in matrix notation, including the model’s underlying assumptions.

(b)  Show that βˆ1  = a(SSXY1 /SSX1 ), where SSXY1  =  Yi (X1i − X1 ) and SSX1  =  (X1i − X1 )2 . That is, βˆ1  is literally the regression coefficient obtained from a simple linear regression, Yi  = β0  +  β 1 X1i + εi , times an adjustment factor a” . What is a”?  Hints: start with βˆ = (XT X)1 XT Y ;  re-write X = [1n  北1  北2 ] where 北1 , 北2  are the 2nd and 3rd columns of matrix X; note that XT X  is block diagonal since 北2(T)1n  = 北1(T)1n  = 0 because the covariates have been centered; βˆ will then be  expressed with combinations of terms like 北1(T)北2 , 北2(T)北2 , etc.  Note SSX1  =北1(T)北1  since the covariate  has been centered; “a” is a = a1 /a2 , where

(1(T)2 )2        

(北2(T)北2 )(北1(T)北1 )

(c)  Use the expression for a” to show that βˆ1  is undefined when 北1 , 北2  are linearly dependent.

(d) What is the name of the quantity ?

Problem 3

Suppose that the true model is Y = Xβ c +Zα+ec , E[ec] = 0, Cov(ec ) = σ2 In , but we fit the smaller model Y = Xβm + em . Assume that X and Z have full rank. Let c  = Y (Xc + Z ) and m  = Y (Xm ). Note that α is also a model parameter that needs to be estimated.

(a)  Suppose ZT X = 0 and ZT Y = 0.

(a.1)  Derive (do not just state) an expression for c  when we correctly specified the model; Derive (do not just state) an expression for m  when the smaller model is used (model misspecification).

Compare c  and m .

(a.2)  Compute E[m].

(a.3)  Show that SSEm SSEc  = 0 where SSEm  = m(T)m  and SSEc  = c(T)c .

(b)  Suppose ZT X = 0 and ZT Y  0.

(b.1)  Derive (do not just state) an expression for c  when we correctly specified the model; Derive (do not just state) an expression for m  when the smaller model is used (model misspecification).

Compare c  and m .

(b.2)  Compute E[m].

(b.3)  Show that SSEm − SSEc  ≥ 0 where SSEm  = m(T)m  and SSEc  = c(T)c .

Problem 4

This is an OPTIONAL problem with no additional points. You will need knowledge about singular value decomposition to solve this problem, which is not covered in class.   This is just an example that although OLS is BLUE by the Gauss-Markov Theorem, if one is willing to have some bias, e.g., the ridge estimator, then one can potentially achieve even smaller variance.

Suppose that we have a design matrix X with centered columns and a centered outcome vector Y , and we wish to perform regression without an intercept.  In Biostats 650 we are mostly interested in least squares estimates, the p-vectors  that minimize the quantity ∥Y ∥2  = (Y )T (Y ). However, there are other possibilities for estimating β . One possibility is to estimate β as the solution to the problem

minimize {∥Y Xβ∥2 + λ∥β∥2 }.     (1)

β

In (1), λ is a positive scalar.  The solution to (1), βridge , is called the ridge  regression  estimate.  We can interpret (1) as seeking a coefficient vector such that the sum of squared residuals is small,  and  such that the ℓ2  norm of the coefficient vector is small as well. We will now derive some simple properties of the ridge estimate. As usual, we assume that Y = Xβ + ε where X is fixed, E[ε] = 0, and Var(ε) = σ I2 .

(a)  By differentiating (1) with respect to β and setting the derivative to zero, derive a simple condition

that the ridge regression estimate must satisfy.  (With λ = 0 this condition would simply be the usual normal equations for linear regression. Derive the condition in the more general case that λ ≥ 0.)

(b)  Now assume that λ > 0.  Prove that the ridge regression estimate takes the form βridge  = (X\ X + λI)1X\ Y , regardless of the rank of X .

(c)  Show that as λ → ∞, the ridge regression estimate converges to 0.

(d)  Argue that the ridge regression estimate is linear in Y .

(e)  Compute the bias of the ridge regression estimate, and compare it to the bias of the least squares

estimate.

(f) Write an expression for the variance of the ridge regression estimate, and compare it to the variance

of the least squares estimate.  The expression for the variance of the ridge regression estimate should be a function of X , λ, and σ 2 .

(g)  Now let UDVT  denote the SVD of X .  (Be specific about the dimensions of U , D, and V .) Rewrite the expression for the variance of the ridge regression estimate in terms of V , D , σ 2 , and λ only.

(h)  Use the expression you just obtained to write out a simple formula for each of the p diagonal elements of the variance matrix for βridge . What does this tell us about the variance of βj  estimated via least squares, versus the variance of βj  estimated via ridge regression?

(i)  Based on your answer to the previous question, explain how ridge regression fixes” the multicollinearity problems experienced by the least squares estimate.

(j)  Summarize what you have learned about the bias, linearity, and variance of the ridge regression esti-

mate, and explain how your findings are consistent with the Gauss-Markov Theorem.