my_t.test: T Test

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs t test on given data

Usage

1
my_t.test(x, alternative, mu)

Arguments

x

Numeric vector of data

alternative

A string specifying types of t test wanted, with choices "two.sided", "less" or "greater".

mu

a number indicating the null hypothesis.

Value

a list including: the numeric test statistic, the degrees of freedom, the type of t test given, and the numeric p-value.

Examples

1
2
3
my_t.test(my_gapminder$lifeExp, "two.sided", 60)
my_t.test(my_gapminder$lifeExp, "less", 60)
my_t.test(my_gapminder$lifeExp, "greater", 60)

RuofengT/stat302package documentation built on Dec. 18, 2021, 11:54 a.m.