Description Usage Arguments Value Examples
This function produce one-sample t-test (two-tailed with confident interval at 0.95) results for multiple sub-groups and provides with a nice output in a table format. It can also add adjusted p values for multiple comparison issue.
1 | t_test_one_sample(data, x, mu = 0, p_adjust = "bonferroni")
|
data |
A grouped data frame. It should be grouped by the intended sub-groups which you want to do the same t-test. |
x |
Column name of the variable which contains data values that you want to test (see t.test and details). |
mu |
A number indicating the true value of the mean (or difference in means if you are performing a two sample test). |
p_adjust |
|
A data.frame
with the t-statistics table
consisting of characters. The columns that are always present are:
group variable(s)
, tvalue
, df
(degrees of freedom), p
, and p_adjustmethod(s)
.
1 2 3 4 5 6 | t_test_one_sample(color_index, "color_index", mu = 0)
# use bonferroni and fdr method for adjusted p values.
library(magrittr)
color_index %>%
t_test_one_sample("color_index", mu = 0, p_adjust = c("bonferroni","fdr"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.