nice_t_test_table.Rd
Creates a t.test table for multiple dependent variables
nice_t_test_table(
dv,
iv,
data,
method = "cohen",
conditions = NULL,
labels = NULL,
concise = TRUE,
nice_p = TRUE,
digits = 1,
var_equal = FALSE,
label_attr = TRUE,
manova = TRUE,
type = "html",
caption = "T-test table",
alternative = "two.sided",
file = NULL
)
t_test_table(...)
A data frame with the dependent variables or a character vector with variable names when data is defined.
A data frame or vector with the independent variable or a character if data is defined.
A data frame.
Either "cohen", "glass, or "hedges".
A character vector of length two with the names of the two conditions. Defaults to the first two levels of the independent variable 'iv' if applicable.
A character vector of length two with labels for the dependent variables.
A more concise table with mean and SD in one column.
If TRUE, p values are printed in a nice format.
Number of digits for rounding mean and SD values
If FALSE, a t-test for unequal variances is calculated.
Either "df" for data frame or "html" for html table.
Table caption is type = "html"
A tibble or an html table
nice_t_test_table(
data = mtcars,
iv = "am",
dv = c("mpg", "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "gear", "carb")
)
Table
T-test table
0
1
0
1
Note. Method for estimating standard deviation: cohen; Manova: Pillai = 0.80; F(10, 21) = 8.36; p = 0.000.
df <- data.frame(
a = c(rnorm(85, 50, 10), rnorm(200, 70, 20)),
b = c(rnorm(85, 50, 10), rnorm(200, 55, 20)),
iv = factor(c(rep("Regular", 85), rep("Special", 100), rep("Restricted", 100)))
)
nice_t_test_table(
c("a", "b"), "iv",
data = df,
conditions = c("Restricted","Special"),
labels = c("Motivation", "Achievement")
)
Table
T-test table
Restricted
Special
Restricted
Special
Note. Method for estimating standard deviation: cohen; Manova: Pillai = 0.01; F(2, 197) = 0.72; p = 0.489.