my_t.test: T-test function

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs a one sample t-test.

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

Numeric vector input to be used as the data for the t-test.

alternative

String input that indicates the alternative hypothesis, which must be one of "two.sided", "greater", or "less".

mu

Numeric input to be used as the true value of mean.

Value

a list having the following elements, test_stat the numeric test statistic, df the degrees of freedom, alternative the string indicating the alternative hypothesis, p_val the numeric p-value.

Examples

1
2
3
x <- rnorm(10, mean = 0, sd = 1)
my_t.test(x, "two.sided", 0)
my_t.test(x, mu = -1, alternative = "less")

yiqunl2-1863642/Project3Package documentation built on Dec. 23, 2021, 8:11 p.m.