Call:
lm(formula = frequency_score ~ group, data = sample)
Coefficients:
(Intercept) groupsquare
39.8 -8.0
What if I want to know the relationship bead shape and the frequency score?
How can we quantify how much we’d expect the difference in means to differ from one random sample to another?
\[ \Large \bar{y}_{circle} - \bar{y}_{square} \]
\[ \Large y = \beta_0 + \beta_1(group == square) + \varepsilon \]
\[ \Large \hat{y} = \hat\beta_0 + \hat\beta_1(group == square) \]
How can we quantify how much we’d expect the slope to differ from one random sample to another?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
We need a test statistic that incorporates \(\hat{\beta}_1\) and the standard error
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
How do we interpret this?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
How do we know what values of this statistic are worth paying attention to?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
How do we calculate the confidence interval for the slope?
\[\hat\beta_1\pm t^*SE_{\hat\beta_1}\]
How do get a confidence interval for \(\hat{\beta}_1\)? What function can we use in R?
How do we interpret this value?
Application Exercise
frequency_score
and group
in your data05:00
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
Is \(\hat\beta_1\) different from 0?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
Is \(\beta_1\) different from 0? (notice the lack of the hat!)
The probability of observing a statistic as extreme or more extreme than the observed test statistic given the null hypothesis is true
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
What is the p-value? What is the interpretation?
Call:
lm(formula = frequency_score ~ group, data = sample)
Residuals:
Min 1Q Median 3Q Max
-38.80 -22.55 -11.80 30.20 95.20
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.800 7.757 5.131 8.82e-06 ***
groupsquare -8.000 10.970 -0.729 0.47
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.69 on 38 degrees of freedom
Multiple R-squared: 0.0138, Adjusted R-squared: -0.01215
F-statistic: 0.5318 on 1 and 38 DF, p-value: 0.4703
Do we reject the null hypothesis?
Application Exercise
appex-06.qmd
frequency_score
and group
with your data02:00