ttest_num {exams.forge}R Documentation

T-tests

Description

Computes all results for a t-test. Note that the results may differ from stats::t.test(), see the "Details". Either named parameters can be given, or a list with the parameters. You must provide either x or mean, sd and n. If x is given then any values given for mean, sd and n will be overwritten. Also either sd or sigma or both must be given.

Usage

ttest_num(..., arglist = NULL)

Arguments

...

named input parameters

arglist

list: named input parameters, if given ... will be ignored

Details

The results of ttest_num may differ from stats::t.test(). ttest_num is designed to return results when you compute a t-test by hand. For example, for computing the test statistic the approximation t_n \approx N(0; 1) is used if n>n.tapprox. The p.value is computed from the cumulative distribution function of the normal or the t distribution.

Value

A list with the input parameters and the following:

Examples

x <- runif(100)
ttest_num(x=x)
ttest_num(mean=mean(x), sd=sd(x), n=length(x))
ret <- ttest_num(x=x)
ret$alternative <- "less"
ttest_num(arglist=ret)

[Package exams.forge version 1.0.10 Index]