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 of data to be tested.

alternative

Charater string specifying the alternative hypothesis. It is one of "two.sided", "less", or "greater".

mu

Numeric input indicating the null hypothesis value of the mean.

Value

A List of test_stat (the numeric test statistic), df (degrees of freedom), p_value (the numeric p-value), and alternative (the value of the parameter alternative).

Examples

1
2
my_t_test(rnorm(100, mean = 0, sd = 1), mu = 0, alternative = "less")
my_t_test(c(1, 2, 3, 4, 5), mu = 3, alternative = "greater")

SimonaLiao/Stat302Package documentation built on March 23, 2020, 9:56 p.m.