my_t.test: Student's t-Test

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs a one sample t-test.

Usage

1
my_t.test(x, alternative = "two.sided", mu)

Arguments

x

A vector with numeric entries that provides the data values for the test.

alternative

A string that specifies the type of the alternative hypothesis for the test. This must be "two.sided", "less", or "greater". Note if no value is given this parameter defaults to "two.sided".

mu

A numeric input that specifies the true mean according the the null hypothesis.

Value

A list containing the following items. The numeric, test_stat, which is the calculated t-test statistic. The numeric, df, which is the degrees of freedom of the test. The string, alternative, which is the alternative hypothesis that was specified. The numeric, p_val, which is the p-value calculated by the tests.

Examples

1
2
my_t.test(x = rnorm(100), alternative = "two.sided", mu = 1)
my_t.test(x = 1:100, alternative = "greater", mu = 60)

thomson3uw/project3part1package documentation built on Dec. 23, 2021, 9:58 a.m.