Lab Report Help
Results: review this week's practical on writing up lab report results
Discussion: review Academic Advising session
Next week's practicals: The Linear Model (both lectures)
Awards: SavioR nominations and Education Awards
Feedback via the Suggestions Box
"Does Hugging Provide Stress-Buffering Social Support? A Study of Susceptibility to Upper Respiratory Infection and Illness" (Cohen et al., 2015)
Participants completed questionnaires and phone interviews over 14 days
"Does Hugging Provide Stress-Buffering Social Support? A Study of Susceptibility to Upper Respiratory Infection and Illness" (Cohen et al., 2015)
Participants completed questionnaires and phone interviews over 14 days
Then exposed to a cold virus! 🤒
"Does Hugging Provide Stress-Buffering Social Support? A Study of Susceptibility to Upper Respiratory Infection and Illness" (Cohen et al., 2015)
Participants completed questionnaires and phone interviews over 14 days
Then exposed to a cold virus! 🤒
Does receipt of hugs have a relationship with infection?
cold_hugs %>% mutate(pct_hugs = pct_hugs*100) %>% ggplot(aes(x = pct_hugs, y = post_nasal_clear_log)) + geom_point(position = "jitter", alpha = .4) + scale_x_continuous(name = "Percentage of Days with Hugs") + scale_y_continuous("Congestion (Log)") + geom_smooth(method = "lm") + cowplot::theme_cowplot()
cold_hugs %>% mutate(pct_hugs = pct_hugs*100) %>% ggplot(aes(x = pct_hugs, y = post_nasal_clear_log)) + geom_point(position = "jitter", alpha = .4) + scale_x_continuous(name = "Percentage of Days with Hugs") + scale_y_continuous("Congestion (Log)") + geom_smooth(method = "lm") + cowplot::theme_cowplot()
Very slight negative relationship
## ## Call:## lm(formula = post_nasal_clear_log ~ pct_hugs, data = cold_hugs)## ## Coefficients:## (Intercept) pct_hugs ## 0.5952 -0.1077
For every unit increase in hugs, congestion changes by -0.11
Here, "unit increase" = 1%
So, congestion goes down by 0.11 for every 1% increase in hugs
Model: Congestioni=0.60−0.11×Hugsi
Investigating whether hugs protect against colds
Linear model shows that more hugs are associated with less congestion (infection)
Is this model any good? What do we mean by "good"?
Investigating whether hugs protect against colds
Linear model shows that more hugs are associated with less congestion (infection)
Is this model any good? What do we mean by "good"?
Captures a relationship that may in fact exist: significance and CIs of b1
Explains the variance in the outcome: R2 for the model
Our recipe for significance testing is:
Data
A test statistic
The distribution of that test statistic under the null hypothesis
The probability p of finding a test statistic as large as the one we have (or larger) if the null hypothesis is true
First, we need to sort out the null hypothesis of b1
Congestioni=b0+0×Hugs1i+ei
cold_hugs %>% mutate(pct_hugs = pct_hugs*100) %>% ggplot(aes(x = pct_hugs, y = post_nasal_clear_log)) + geom_point(position = "jitter", alpha = .4) + scale_x_continuous(name = "Percentage of Days with Hugs") + scale_y_continuous("Congestion (Log)") + geom_smooth(method = "lm") + geom_hline(yintercept = mean(cold_hugs$post_nasal_clear_log, na.rm = T), linetype = "dashed", colour = "purple3")+ cowplot::theme_cowplot()
b1 = 0 represents the null hypothesis
For our model, does b1 = 0?
Is our estimate of b1 different enough from 0 to believe that it may actually not be 0 in the population?
b1SEb1=t
Compare our value of t to the t-distribution to get p, just as we've seen before
If p is smaller than our chosen alpha level, our predictor is considered to be significant
Term | b | SEb | t | p |
---|---|---|---|---|
Intercept | 0.60 | 0.04 | 16.04 | < .001 |
Percentage of Days with Hugs | -0.11 | 0.05 | -2.05 | .041 |
Give us the range of likely sample estimates of β1 from other samples
Only if our interval is one of the 95% of intervals that does in fact contain the population value!
Review Lecture 2 for more on CIs
Give us the range of likely sample estimates of β1 from other samples
Only if our interval is one of the 95% of intervals that does in fact contain the population value!
Review Lecture 2 for more on CIs
Key info: does the confidence interval cross or include 0?
hugs_lm %>% summary()
## ## Call:## lm(formula = post_nasal_clear_log ~ pct_hugs, data = cold_hugs)## ## Residuals:## Min 1Q Median 3Q Max ## -0.59522 -0.27880 0.01766 0.25219 0.79262 ## ## Coefficients:## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 0.59522 0.03710 16.043 <0.0000000000000002 ***## pct_hugs -0.10773 0.05243 -2.055 0.0405 * ## ---## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1## ## Residual standard error: 0.3572 on 403 degrees of freedom## (1 observation deleted due to missingness)## Multiple R-squared: 0.01037, Adjusted R-squared: 0.007912 ## F-statistic: 4.222 on 1 and 403 DF, p-value: 0.04055
The linear model (LM) expresses the relationship between at least one predictor, x, and an outcome, ^y
Linear model equation: yi=b0+b1x1i+ei
Most important result is the parameter b1, which expresses the change in y for each unit change in x
Evaluating the model
Is it unlikely that b1 isn't 0? Significance tests and CIs
How well does the model fit the data? R2 and adjusted R2
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 |