my_t_test: Student's t-test

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

This function performs a one sample student's t-test on a vector of data.

Usage

1
my_t_test(x, alternative, mu)

Arguments

x

a numeric vector of data.

alternative

a character string specifying the alternative hypothesis. This only accepts "two.sided", "less", or "greater".

mu

a number indicating the null hypothesis value of the mean.

Value

A list with elements: test_stat, the numeric test statistic; df, a numeric containing the degrees of freedom; alternative character containing the value of the parameter alternative; p_val, a numeric p-value.

Examples

1
2
my_t_test(c(1, 5 ,4 , 5, 2, 6, 4), "greater", 5)
my_t_test(1:20, "two.sided", 18)

MatteVin/myfirstpackage documentation built on March 20, 2020, 9:45 p.m.