[1] 1.959964
\[z = \frac{\hat\beta_1}{SE_{\hat\beta_1}}\]
How is this different from the test statistic for linear regression?
\[z = \frac{\hat\beta_1}{SE_{\hat\beta_1}}\]
How is this different from the test statistic for linear regression?
\[\color{red}z = \frac{\hat\beta_1}{SE_{\hat\beta_1}}\]
What do you think goes in this blank to calculate a confidence interval (instead of \(t^*\) as it was for linear regression)?
\[\hat\beta_1 \pm [\_^*] SE_{\hat\beta_1}\]
What do you think goes in this blank to calculate a confidence interval (instead of \(t^*\) as it was for linear regression)?
\[\hat\beta_1 \pm [\color{red}z^*] SE_{\hat\beta_1}\]
Where are my degrees of freedom when calculating \(z^*\)?
\[\hat\beta_1 \pm [\color{red}z^*] SE_{\hat\beta_1}\]
\[\hat\beta_1 \pm [\color{red}z^*] SE_{\hat\beta_1}\]
How do you convert log(odds) to odds?
\[\hat\beta_1 \pm [\color{red}z^*] SE_{\hat\beta_1}\]
How do you convert log(odds) to odds?
\[e^{\hat\beta_1 \pm [\color{red}z^*] SE_{\hat\beta_1}}\]
We are interested in the relationship between Backpack weight and Back problems.
library(Stat2Data)
data("Backpack")
mod <- glm(BackProblems ~ BackpackWeight,
data = Backpack,
family = "binomial")
exp(coef(mod))
(Intercept) BackpackWeight
0.2805017 1.0444660
2.5 % 97.5 %
(Intercept) -2.28602740 -0.3214891
BackpackWeight -0.02912583 0.1180606
2.5 % 97.5 %
(Intercept) 0.1016696 0.7250685
BackpackWeight 0.9712942 1.1253124
Are these models nested?
What are the degrees of freedom for the deviance for Model 1?
What are the degrees of freedom for the deviance for Model 1?
What are the degrees of freedom for the deviance for Model 2?
What are the degrees of freedom for the deviance for Model 2?
\[(-2\log\mathcal{L}_1) - (-2\log\mathcal{L}_2)\]
What do you think the degrees of freedom are for this difference?
\[(-2\log\mathcal{L}_1) - (-2\log\mathcal{L}_2)\]
What is the null hypothesis again?
\[(-2\log\mathcal{L}_1) - (-2\log\mathcal{L}_2)\]
☝️ test statistic
How do you think we compute a p-value for this test?
\[(-2\log\mathcal{L}_1) - (-2\log\mathcal{L}_2)\]
☝️ test statistic
Call:
glm(formula = Acceptance ~ GPA, family = "binomial", data = MedGPA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7805 -0.8522 0.4407 0.7819 2.0967
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -19.207 5.629 -3.412 0.000644 ***
GPA 5.454 1.579 3.454 0.000553 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 75.791 on 54 degrees of freedom
Residual deviance: 56.839 on 53 degrees of freedom
AIC: 60.839
Number of Fisher Scoring iterations: 4
What is the “drop in deviance”?
Call:
glm(formula = Acceptance ~ GPA, family = "binomial", data = MedGPA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7805 -0.8522 0.4407 0.7819 2.0967
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -19.207 5.629 -3.412 0.000644 ***
GPA 5.454 1.579 3.454 0.000553 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 75.791 on 54 degrees of freedom
Residual deviance: 56.839 on 53 degrees of freedom
AIC: 60.839
Number of Fisher Scoring iterations: 4
What are the degrees of freedom for this difference?
Call:
glm(formula = Acceptance ~ GPA, family = "binomial", data = MedGPA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7805 -0.8522 0.4407 0.7819 2.0967
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -19.207 5.629 -3.412 0.000644 ***
GPA 5.454 1.579 3.454 0.000553 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 75.791 on 54 degrees of freedom
Residual deviance: 56.839 on 53 degrees of freedom
AIC: 60.839
Number of Fisher Scoring iterations: 4
What are the degrees of freedom for this difference?
Call:
glm(formula = Acceptance ~ GPA, family = "binomial", data = MedGPA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7805 -0.8522 0.4407 0.7819 2.0967
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -19.207 5.629 -3.412 0.000644 ***
GPA 5.454 1.579 3.454 0.000553 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 75.791 on 54 degrees of freedom
Residual deviance: 56.839 on 53 degrees of freedom
AIC: 60.839
Number of Fisher Scoring iterations: 4
What is the result of the hypothesis test? How do you interpret this?
Call:
glm(formula = Acceptance ~ GPA, family = "binomial", data = MedGPA)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.7805 -0.8522 0.4407 0.7819 2.0967
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -19.207 5.629 -3.412 0.000644 ***
GPA 5.454 1.579 3.454 0.000553 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 75.791 on 54 degrees of freedom
Residual deviance: 56.839 on 53 degrees of freedom
AIC: 60.839
Number of Fisher Scoring iterations: 4