How do we check these conditions?
How do we check these conditions?
Condition | Graph |
---|---|
Linearity | Residuals vs. fits |
Zero Mean | by default it's true |
Constant Variance | Residuals vs fits |
Independence | No formal check |
Random | No formal check |
Normality | QQ-plot or histogram of residuals |
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 |
What is the proportion of sucess when length is 3?
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 |
What is the proportion of sucesses when length is 3?
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 |
What are the odds of success when length is 3?
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 |
What are the odds of success when length is 3?
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 |
What are the log(odds) of success when length is 3?
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 |
What are the log(odds) of success when length is 3?
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 |
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() + labs(y = "log odds of success")
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 if the x variable isn't discrete?
What if the x variable isn't discrete?
Does randomness hold?
During the 1970s, when women were entering the workforce in substantial numbers for the first time since World War II, many men were opposed to the trend. One study chose a random sample of men and asked them to agree or disagree with the statement “Women should stay in the home and let men run the country.” A linear logistic regression relating the proportion of men who agreed to their years of education showed a strong relationship with a negative slope: The more time a man spent in school, the less likely he was to agree.
Does randomness hold?
During the 1970s, when women were entering the workforce in substantial numbers for the first time since World War II, many men were opposed to the trend. One study chose a random sample of men and asked them to agree or disagree with the statement “Women should stay in the home and let men run the country.” A linear logistic regression relating the proportion of men who agreed to their years of education showed a strong relationship with a negative slope: The more time a man spent in school, the less likely he was to agree.
Does randomness hold?
One of the authors of our Stat2Data book tried to apply logistic regression to a bluegrass banjo "roll", an eight-note sequence with a fixed pattern. According to the logistic model, the predictor is the time in the sequence when the note is played (1 to 8) and the response is whether the note is picked with the thumb:
Forward roll: | 1 2 3 4 5 6 7 8 |
---|---|
Thumb? (1 = Yes) | 1 0 0 1 0 0 1 0 |
Does randomness hold?
One of the authors of our Stat2Data book tried to apply logistic regression to a bluegrass banjo "roll", an eight-note sequence with a fixed pattern. According to the logistic model, the predictor is the time in the sequence when the note is played (1 to 8) and the response is whether the note is picked with the thumb:
Forward roll: | 1 2 3 4 5 6 7 8 |
---|---|
Thumb? (1 = Yes) | 1 0 0 1 0 0 1 0 |
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 |