my_t_test: My t-test function

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

This function performs a one sample t-test in R.

Usage

1
my_t_test(x, alternative, mu)

Arguments

x

a non-empty numeric vector of data values.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided", "greater" or "less".

mu

a number indicating the true value of the mean (or difference in means if you are performing a two sample test).

Value

the t test results of x: a list includes, test_stat, the value of the test statistic; df, the degrees of freedom; alternative a character string describing the alternative hypothesis; p_val, the p-value for the test.

Examples

1
2
my_t_test(x = c(1:200), alternative = "less", mu = 25)
my_t_test(c(1:100), "greater", 10)

atlasyao/happypackage documentation built on March 23, 2020, 5:23 a.m.