my_t.test: Student's 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 numeric vector of data.

alternative

a character string specifying the alternative hypothesis. This should only accept "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

the degrees of freedom

alternative

the value of the parameter alternative

p_val

the numeric p-value

Examples

1
2
trial <- rnorm(30, 4, 7)
t.test(trial, alternative = "less", mu = 4)

txqtiffany/STAT302package documentation built on Dec. 23, 2021, 1:03 p.m.