nice_t_test_table.RdCreates a t-test table for multiple dependent variables
nice_t_test_table(
dv,
iv,
data,
method = "cohen",
conditions = NULL,
labels = NULL,
labels_conditions = NULL,
concise = TRUE,
nice_p = TRUE,
digits = 1,
var_equal = FALSE,
label_attr = TRUE,
manova = TRUE,
caption = NULL,
alternative = "two.sided",
file = NULL,
...
)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.
Vector of length 2 which resets condition labels.
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.
If TRUE, variable labels are used if available.
If TRUE, a MANOVA is calculated and its results are added to the note.
Table caption is type = "html"
A character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "greater" or "less".
Character string with filename. If set, an additional file is
exported (html format is possible). If set TRUE, a filename is
automatically created based on the title.
Additional arguments passed to nice_table().
A data.frame 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 comparing conditions 0 vs. 1 in variable am
0
1
0
1
Note. Method for estimating d: 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 comparing conditions Restricted vs. Special in variable iv
Restricted
Special
Restricted
Special
Note. Method for estimating d: cohen; Manova: Pillai = 0.00; F(2, 197) = 0.39; p = 0.678.