2025-09-20
Independent T Test
\[ t = \frac{\bar{x_1} - \bar{x_2}}{\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}} \]
Paired T Test Calculation \[ t = \frac{\bar{D}}{s_D / \sqrt{n}} \] * D_bar = the mean of the differences * sD = the standard deviation of the differences * n = the number of samples or sample size
(t.test(group1, group2, paired = TRUE or FALSE, var.equal = TRUE or FALSE))
Here is a sample data frame:
## ## Welch Two Sample t-test ## ## data: in_school_group and out_school_group ## t = -0.16059, df = 17.95, p-value = 0.8742 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -5.634183 4.834183 ## sample estimates: ## mean of x mean of y ## 4.6 5.0