Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean |
Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean | The error distribution is centered at zero | by default | -- |
Constant Variance |
Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean | The error distribution is centered at zero | by default | -- |
Constant Variance | The variability in the errors is the same for all values of the predictor variable | Residuals vs fits plot | fit a better model |
Independence |
Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean | The error distribution is centered at zero | by default | -- |
Constant Variance | The variability in the errors is the same for all values of the predictor variable | Residuals vs fits plot | fit a better model |
Independence | The errors are assumed to be independent from one another | 👀 data generation | Find better data or fit a fancier model |
Random |
Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean | The error distribution is centered at zero | by default | -- |
Constant Variance | The variability in the errors is the same for all values of the predictor variable | Residuals vs fits plot | fit a better model |
Independence | The errors are assumed to be independent from one another | 👀 data generation | Find better data or fit a fancier model |
Random | The data are obtained using a random process | 👀 data generation | Find better data or fit a fancier model |
Normality |
Assumption | What it means | How do you check? | How do you fix? |
---|---|---|---|
Linearity | The relationship between the outcome and explanatory variable or predictor is linear holding all other variables constant | Residuals vs. fits plot | fit a better model (transformations, polynomial terms, more / different variables, etc.) |
Zero Mean | The error distribution is centered at zero | by default | -- |
Constant Variance | The variability in the errors is the same for all values of the predictor variable | Residuals vs fits plot | fit a better model |
Independence | The errors are assumed to be independent from one another | 👀 data generation | Find better data or fit a fancier model |
Random | The data are obtained using a random process | 👀 data generation | Find better data or fit a fancier model |
Normality | The random errors follow a normal distribution | QQ-plot / residual histogram | fit a better model |
How do we test linearity?
How do we test linearity?
Length | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|
Number of successes | 84 | 88 | 61 | 61 | 44 |
Number of failures | 17 | 31 | 47 | 64 | 90 |
Total | 101 | 119 | 108 | 125 | 134 |
Probability of success | 0.832 | 0.739 | 0.565 | 0.488 | 0.328 |
Odds of success | 4.941 | 2.839 | 1.298 | 0.953 | 0.489 |
Empirical logit | 1.60 | 1.04 | 0.26 | −0.05 | −0.72 |
data <- data.frame( length = c(3, 4, 5, 6, 7), emp_logit = c(1.6, 1.04, 0.26, -0.05, -0.72))ggplot(data, aes(length, emp_logit)) + geom_point() + geom_abline(intercept = 3.26, slope = -0.566, lty = 2) + labs(y = "log odds of success")
What do I put for the family argument if I want to fit a logistic regression in R?
glm(am ~ mpg, data = mtcars, family = "---")
What do I put for the family argument if I want to fit a logistic regression in R?
glm(am ~ mpg, data = mtcars, family = "binomial")
What do I put for the family argument if I want to fit a logistic regression in R?
glm(am ~ mpg, data = mtcars, family = "binomial")
What do I put for the family argument if I want to fit a logistic regression in R?
glm(am ~ mpg, data = mtcars, family = "binomial")
What do I put for the family argument if I want to fit a logistic regression in R?
glm(am ~ mpg, data = mtcars, family = "binomial")
"binomial"
family, your book talks about the Bernoulli distribution, I just want to bridge the gapThe Spinner
The Spinner
The Spinner
The Spinner
The Spinner
The Spinner
The Spinner
The Spinner
The Spinner
The Spinner
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |