ttest1: One sample t-test for a vector

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ttest_related_functions.R

Description

One sample t-test for a vector.

Usage

1
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

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

Rfast documentation built on Dec. 11, 2021, 9:59 a.m.