After completing this lecture and the workshop you should have had the opportunity to …
Two Sample t-test
data: rt by age_2
t = 15.918, df = 704, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
177.1910 227.0489
sample estimates:
mean in group old-ish mean in group young-ish
746.4182 544.2982
# A tibble: 353 x 3
id dominant nondominant
<dbl> <dbl> <dbl>
1 1 702. 780.
2 2 471. 497
3 3 639. 638
4 4 708 639.
5 5 607. 652
6 6 542. 499.
7 7 571. 527.
8 8 509. 547.
9 9 737. 865.
10 10 550. 569.
# … with 343 more rows
Paired t-test
data: vec_1 and vec_2
t = -0.31154, df = 352, p-value = 0.7556
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-14.49468 10.53057
sample estimates:
mean of the differences
-1.982059
# A tibble: 706 x 3
id rt age_3
<dbl> <dbl> <ord>
1 1 702. old-ish
2 1 780. old-ish
3 2 471. young-ish
4 2 497 young-ish
5 3 639. middle
6 3 638 middle
7 4 708 old-ish
8 4 639. old-ish
9 5 607. old-ish
10 5 652 old-ish
# … with 696 more rows
Df Sum Sq Mean Sq F value Pr(>F)
age_3 2 8173425 4086713 151.9 <2e-16 ***
Residuals 703 18910154 26899
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
[1] 2
[1] 703
# A tibble: 2 x 6
term df sumsq meansq statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 age_3 2 8173425. 4086713. 152. 1.45e-55
2 Residuals 703 18910154. 26899. NA NA
[1] 4086712.58 26899.22
[1] 151.9268
# A tibble: 353 x 3
id dominant nondominant
<dbl> <dbl> <dbl>
1 1 702. 780.
2 2 471. 497
3 3 639. 638
4 4 708 639.
5 5 607. 652
6 6 542. 499.
7 7 571. 527.
8 8 509. 547.
9 9 737. 865.
10 10 550. 569.
# … with 343 more rows
Pearson's product-moment correlation
data: dominant and nondominant
t = 26.574, df = 351, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.7794094 0.8492324
sample estimates:
cor
0.8172993
# A tibble: 706 x 3
id rt age
<dbl> <dbl> <dbl>
1 1 702. 84
2 1 780. 84
3 2 471. 37
4 2 497 37
5 3 639. 62
6 3 638 62
7 4 708 85
8 4 639. 85
9 5 607. 73
10 5 652 73
# … with 696 more rows
Call:
lm(formula = rt ~ age, data = blomkvist)
Residuals:
Min 1Q Median 3Q Max
-374.81 -93.02 -27.81 54.43 1290.35
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 346.3363 17.3053 20.01 <2e-16 ***
age 5.2929 0.2942 17.99 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 162.3 on 704 degrees of freedom
Multiple R-squared: 0.315, Adjusted R-squared: 0.314
F-statistic: 323.7 on 1 and 704 DF, p-value: < 2.2e-16