Class Activity, February 17

In this class activity, we will explore Wald tests with the dengue data. You can load the dengue data into R with the following code:

dengue <- read.csv("https://sta711-s23.github.io/homework/dengue.csv")

Questions

  1. Fit the following logistic regression model in R:

\[Y_i \sim Bernoulli(p_i)\]

\[\log \left( \dfrac{p_i}{1 - p_i} \right) = \beta_0 + \beta_1 WBC_i + \beta_2 PLT_i\]

  1. Calculate the estimated Fisher information matrix \(\mathcal{I}(\widehat{\beta}) = X^TWX\), where \(X\) is the design matrix for the model in question 1, and \(W\) is a diagonal matrix with diagonal entries \(w_i = \widehat{p}_i(1 - \widehat{p}_i)\). (Note that if m1 is a fitted logistic regression model, then m1$weights gives you a vector of the \(w_i\) in R).

  2. Confirm that the diagonal entries of \(\mathcal{I}(\widehat{\beta})^{-1} = (X^TWX)^{-1}\) agree with the estimated coefficient variances in the summary output from your fitted logistic regression model in question 1.

  3. Use a Wald test to test the hypotheses \(H_0: \beta_1 = 0\) vs. \(H_A: \beta_1 \neq 0\).