tValue

David Bourne david@boomer.org
Find my other Apps, eBooks and an AppleTV app at https://www.pharmpk.com/MyeBooks.html
22 Oct 2017 v1.2 Submitted for approval


17 Sep 2017 v1.1 Approved and available

Download from the App Store.


11 May 2016 v1.0.2 Approved and available


5 May 2016 v1.0.1 Approved


10 Feb 2016 v1.0.0 Approved

Unpaired t-test: Unequal or Equal variance and Unequal sample size

Example Data

  30.02 29.89
  29.99 29.93
  30.11 29.72
  29.97 29.98
  30.01 30.02
  29.99 29.98
  30.00  
  30.04  
Mean 30.01625 29.92
Std Dev 0.04340425 0.1078888
n 8 6

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
tValue Screenshot

One Sample t-test or Paired t-test

tValue 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.

Example Data

  0.213
  0.134
  0.043
  1.34
Mean 0.4325
Std Dev 0.6090
n 4

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
One sample t-test
tValue Screenshot
Paired t-test
tValue Screenshot

References
David Bourne (david@boomer.org)