stats.ttest(n = NULL, m = NULL, s = NULL, mu0 = NULL,
n1 = NULL, n2 = NULL, m1 = NULL, m2 = NULL, s1 = NULL, s2 = NULL,
Ynm = "Y", Xnm = "X", X1nm = "Group1", X2nm = "Group2",
conf.level = 0.95, digits.d = NULL, ...)
ttest
function included in this package, which performs the independent-groups t-test from the data, as well as the standard t.test
function. In contrast, stats.ttest
performs the analysis from the basic summary statistics: the sample size, sample mean and sample standard deviation for either one group or for each of two groups. Accordingly, there is no graphic output from this function as with ttest
.This version of stats.ttest
assumes homogeneity of variance in the computation of the standard error of the mean difference. Also, only a two-sided test is provided. The null hypothesis is a population mean difference of 0.
If the sample size, sample mean and sample standard deviation are presented only for one group, then the hypothesized value should be specified with the mu0
parameter. If not specfied for one group, then the hypothesis is not done and only the confidence interval is reported. For two groups, the null hypothesis for the population mean difference is assumed to be zero.
The number of decimal digits is determined by default from the largest number of decimal digits of the entered descriptive statistics. The number of decimal digits is then set at that value, plus one more. Or, override the default with the digits.d
parameter.
ttest
, t.test
.# two-groups
# null hypothesis mean difference is zero
stats.ttest(n1=19, n2=15, m1=9.5, m2=8, s1=1.4, s2=1.5,
Ynm="Time", Xnm="Gender", X1nm="Men", X2nm="Women",
conf.level=0.95, digits.d=2)
# one-group
stats.ttest(n=25, m=350.86, s=2.66, mu0=350, Ynm="Weight")
Run the code above in your browser using DataLab