my_t.test: T-test

Description Usage Arguments Value Examples

View source: R/my_t.test.R

Description

This function performs t-test for given value.

Usage

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

Arguments

x

A numeric vector of data

alternative

A character string specifying the alternative hypothesis. This should only accept "two.sided", "less", or "greater". Otherwise, your function should throw an informative error.

mu

A number indicating the null hypothesis value of the mean.

Value

A list consisting following elements: test_stat : The numeric test statistics df : The degree of freedom alternative : The value of parameter alternative p_val : The numeric p value

Examples

1
2
x <- rnorm(10, mean = 0, sd = 1)
my_t.test(x, alternative = "two.sided", mu = 0)

samcho11/STAT302package documentation built on Dec. 22, 2021, 10:10 p.m.