Skip to contents

This function computes degrees of freedom for a 2-sample t-test from the standard deviations and sample sizes of the two samples.

Usage

tdf(sd1, sd2, n1, n2)

Arguments

sd1

standard deviation of the sample 1

sd2

standard deviation of the sample 2

n1

size of sample 1

n2

size of sample 2

Value

estimated degrees of freedom for 2-sample t-test

Examples

data(KidsFeet, package="mosaicData")
fs <- favstats( length ~ sex, data=KidsFeet ); fs
#>   sex  min    Q1 median   Q3  max     mean       sd  n missing
#> 1   B 22.9 24.35  24.95 25.8 27.5 25.10500 1.216758 20       0
#> 2   G 21.6 23.65  24.20 25.1 26.7 24.32105 1.330238 19       0
t.test( length ~ sex, data=KidsFeet )
#> 
#> 	Welch Two Sample t-test
#> 
#> data:  length by sex
#> t = 1.9174, df = 36.275, p-value = 0.06308
#> alternative hypothesis: true difference in means between group B and group G is not equal to 0
#> 95 percent confidence interval:
#>  -0.04502067  1.61291541
#> sample estimates:
#> mean in group B mean in group G 
#>        25.10500        24.32105 
#> 
tdf( fs[1,'sd'], fs[2,'sd'], fs[1,'n'], fs[2,'n'])
#> [1] 36.27481