report.ttest | R Documentation |
This function performs a t-test on a given categorical variable and a set of numerical variables. It also optionally computes Hedges' G effect size and confidence intervals.
report.ttest(catVarName, numVarNames, data, hedgesG = FALSE, CI = FALSE)
catVarName |
A string. The name of the categorical variable to be used in the t-tests. |
numVarNames |
A vector of strings. The names of the numerical variables to be used in the t-tests. |
data |
A data frame or an object of class |
hedgesG |
A logical. If |
CI |
A logical. If |
A matrix with the results of the t-tests. Each row corresponds to one of the numerical variables, and the columns show the means for each level of the categorical variable, the t-statistic, the degrees of freedom, the p-value, and optionally the confidence intervals and Hedges' G effect size.
This function assumes that the categorical variable is a factor. If the variable is not a factor, it will be converted to a factor within the function.
Marjan Cugmas
t.test
report.ttest(catVarName = "am", c("mpg", "disp"), mtcars, hedgesG = TRUE, CI = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.