Compare means for two or more variables

Description

Compare means for two or more variables

Usage

1
2
3
compare_means(dataset, var1, var2, samples = "independent",
  alternative = "two.sided", conf_lev = 0.95, comb = "",
  adjust = "none", test = "t", data_filter = "")

Arguments

dataset

Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant

var1

A numeric variable or factor selected for comparison

var2

One or more numeric variables for comparison. If var1 is a factor only one variable can be selected and the mean of this variable is compared across (factor) levels of va1r

samples

Are samples independent ("independent") or not ("paired")

alternative

The alternative hypothesis ("two.sided", "greater" or "less")

conf_lev

Span of the confidence interval

comb

Combinations to evaluate

adjust

Adjustment for multiple comparisons ("none" or "bonf" for Bonferroni)

test

t-test ("t") or Wilcox ("wilcox")

data_filter

Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")

Details

See https://radiant-rstats.github.io/docs/basics/compare_means.html for an example in Radiant

Value

A list of all variables defined in the function as an object of class compare_means

See Also

summary.compare_means to summarize results

plot.compare_means to plot results

Examples

1
2
result <- compare_means("diamonds","cut","price")
result <- diamonds %>% compare_means("cut","price")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.