Learn R Programming

radiant (version 0.1.95)

compare_means: Compare means for two or more variables

Description

Compare means for two or more variables

Usage

compare_means(dataset, cm_var1, cm_var2, data_filter = "", cm_paired = "independent", cm_alternative = "two.sided", cm_sig_level = 0.95, cm_adjust = "none")

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
cm_var1
A numeric variable or factor selected for comparison
cm_var2
One or more numeric variables for comparison. If cm_var1 is a factor only one variable can be selected and the mean of this variable is compared across (factor) levels of cm_var1
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")
cm_paired
Are samples indepent ("independent") or not ("paired")
cm_alternative
The alternative hypothesis ("two.sided", "greater" or "less")
cm_sig_level
Span of the confidence interval
cm_adjust
Adjustment for multiple comparisons ("none" or "bonf" for Bonferroni)

Value

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

Details

See http://vnijs.github.io/radiant/quant/compare_means.html for an example in Radiant

See Also

summary.compare_means to summarize results

plot.compare_means to plot results

Examples

Run this code
result <- compare_means("diamonds","cut","price")

Run the code above in your browser using DataLab