my_t_test | R Documentation |
Performs a one sample t-test on vectors of data.
my_t_test(data, mu, alt = "two.sided")
data |
A numeric vector of data. |
mu |
A number indicating the null hypothesis value of the mean. |
alt |
A character string specifying the alternative hypothesis, must be one of the "two.sided (default)", "less", or "greater". |
A list containing the following components:
test_stat: the numeric test statistic;
df: the degrees of freedom;
alternative: the value of the parameter alternative;
p_val: the numeric p-value.
my_t_test(1:10, mu = 5, alt = "greater")
# my_t_test on a normal distribution data
test <- rnorm(10, mean = 1, sd = 0)
my_t_test(test, 0, "two.sided")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.