Unpaired t-test: Unequal or Equal variance and Unequal sample size
The result using R Studio and R Using the Welch-Satterthwaite Method > b1 [1] 30.02 29.99 30.11 29.97 30.01 29.99 30.00 30.04 > b2 [1] 29.89 29.93 29.72 29.98 30.02 29.98 > sd(b1) [1] 0.04340425 > sd(b2) [1] 0.1078888 > t.test(b1,b2) Welch Two Sample t-test data: b1 and b2 t = 2.0636, df = 6.2221, p-value = 0.08296 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -0.01689914 0.20939914 sample estimates: mean of x mean of y 30.01625 29.92000 Using a Pooled mathod
> t.test(b1,b2,var.equal = TRUE) Two Sample t-test data: b1 and b2 t = 2.3107, df = 12, p-value = 0.03943 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.005492236 0.187007764 sample estimates: mean of x mean of y 30.01625 29.92000 |
![]() |
One Sample t-test or Paired t-testtValue can also be used to calculate a t value when only set of data is being compared with zero or another specified value. This method can also be used for a paired t-test once the difference between paired values is calculated.
Leave the second set of values empty. The result using R Studio and R
> a2 <- c(0.213,0.134,0.043,1.34) > sd(a2) [1] 0.6089743 > t.test(a2) One Sample t-test data: a2 t = 1.4204, df = 3, p-value = 0.2506 alternative hypothesis: true mean is not equal to 0 95 percent confidence interval: -0.536514 1.401514 sample estimates: mean of x 0.4325 And data for a paired t-test > b1 [1] 30.02 29.99 30.11 29.97 30.01 29.99 30.00 30.04 > b2 [1] 29.89 29.93 29.72 29.98 30.02 29.98 29.97 30.01 > c1 <- b1-b2 > c1 [1] 0.13 0.06 0.39 -0.01 -0.01 0.01 0.03 0.03 > sd(c1) [1] 0.1336774 > t.test(b1,b2,var.equal = TRUE,paired = TRUE) Paired t-test data: b1 and b2 t = 1.6662, df = 7, p-value = 0.1396 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: -0.03300709 0.19050709 sample estimates: mean of the differences 0.07875 |
![]() |
![]() |