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, mu, alternative)

Arguments

x

Numeric vector of data.

mu

Numeric input for a number indicating the null hypothesis value of the mean.

alternative

A character string, either "two.sided", "less", or "greater", that specifies the alternative hypothesis.

Value

a list with elements:

test_stat: the numeric test statistic; df: the degrees of freedom; alternative: the value of the parameter alternative; p_val: the numeric p-value.

Examples

1
2
my_t.test(rnorm(100), 0, "greater")
my_t.test(rnorm(100), 0, "two.sided")

Cherry-ty-Pan/STAT302package documentation built on Dec. 17, 2021, 2 p.m.