my_t.test: t-test

Description Usage Arguments Value Examples

View source: R/my_t_test.R

Description

This function takes input data, a hypothesis test, a null hypothesis value, and returns a list of the computed t statistic, the degrees of freedom, the hypothesis test used, and the computed p value

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

Numeric vector of the input data

alternative

A character representing the hypothesis test we want to compute: "two.sided", "less", or "greater

mu

A number indicating the null hypothesis value of the mean

Value

A list containing the test statistic, the degrees of freedom, the hypothesis test, and the computed p value

Examples

1
2
3
4
x <- rnorm(100, mean = 0, sd = 1)
my_t.test(x, "less", 0)
my_t.test(x, "greater", 0)
my_t.test(x, "two.sided", 0)

dzeng8/STAT302PACKAGE documentation built on Dec. 20, 2021, 2:19 a.m.