compare_means_between_groups {uxr} | R Documentation |
Compare Means Between Groups
Description
Compare Means Between Groups
Usage
compare_means_between_groups(
data,
var1,
var2,
variable,
grouping_variable,
groups,
test = "Welch",
input = "wide",
output = "console"
)
Arguments
data |
data |
var1 |
variable 1 |
var2 |
variable 2 |
variable |
variable |
grouping_variable |
Group |
groups |
Specify groups from grouping variable |
test |
Default: "Welch", choose between "student" and "Welch" |
input |
Default: "wide", choose between "long" and "wide". "wide" requires data var1 var2. "long" requires data, variable, grouping_variable groups |
output |
Default: "console" - prints output in console and returns tibble invisibly. |
Value
results
Examples
# Wide data - default
data_wide <- data.frame(A = c(4, 2, 5, 3, 6, 2, 5),
B = c(5, 2, 1, 2, 1, 3, 2))
compare_means_between_groups(data_wide, var1 = A, var2 = B)
# Long data
data_long <- data_wide |> tibble::rowid_to_column("id") |>
tidyr::pivot_longer(cols = -id, names_to = "group", values_to = "variable")
compare_means_between_groups(data_long, variable = variable,
grouping_variable = group, groups = c("A", "B"), input = "long")
[Package uxr version 0.2.0 Index]