my_t_test: t-test

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

This function performs one-sample t-tests on vectors of data.

Usage

1
my_t_test(x, alternative, mu)

Arguments

x

Numeric vector of data values.

alternative

Character string of the alternative hypothesis, must be either "two.sided", "less", or "greater".

mu

Numeric of true value of the mean.

Value

A list containing the following:

t_stat, the value of the test statistic.

df, the degrees of freedom for the t-statistic.

alternative, the alternative hypothesis.

p_val, the p-value for the test.

Examples

1
2
my_t_test(1:10, "two.sided", 0)
my_t_test(rnorm(10), "less", 0)

hchang23/firstpackage documentation built on March 18, 2020, 7:37 a.m.