One sample t-test for a vector {Rfast}R Documentation

One sample t-test for a vector

Description

One sample t-test for a vector.

Usage

ttest1(x, m, alternative = "unequal", logged = FALSE, conf = NULL)

Arguments

x

A numerical vector with the data.

m

The mean value under the null hypothesis.

alternative

The alternative hypothesis, "unequal", "greater" or "less".

logged

Should the p-values be returned (FALSE) or their logarithm (TRUE)?

conf

If you want a confidence interval supply the confidence level.

Details

The usual one sample t-test is implemented, only faster.

Value

A list including:

res

A two valued vector with the test statistic and its (logged) p-value.

ci

In the case you supplied a number in the input argument "conf" the relevant confidence interval will be returned as well.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>

See Also

ttest, anova1, ttests

Examples

x = rnorm(500)
res<-t.test(x, mu = 0)
res<-ttest1(x, 0, conf = 0.95)

[Package Rfast version 2.1.0 Index]