my_t.test: T-test function

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs a t-test on input data and null hypothesis mu.

Usage

1
my_t.test(x, alternative = "two.sided", mu)

Arguments

x

Numeric vector input of data.

alternative

A character string input that specifies the alternative hypothesis, defaults to "two.sided". Also accepts "less" and "greater".

mu

Numeric input specifying the null hypothesis of the mean.

Value

List with the following elements: Test statistic, degrees of freedom, alternative hypothesis, and P-value.

Examples

1
2
3
4
set.seed(111)
x <- rnorm(10, mean = 0, sd = 1)
my_t.test(x, mu = 0)
my_t.test(x, alternative = "less", mu = 1)

marcradke/StatsTools documentation built on Dec. 21, 2021, 1:51 p.m.