Learn R Programming

radiant (version 0.1.95)

compare_props: Compare proportions across groups

Description

Compare proportions across groups

Usage

compare_props(dataset, cp_var1, cp_var2, data_filter = "", cp_levels = "", cp_alternative = "two.sided", cp_sig_level = 0.95, cp_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
cp_var1
A grouping variable to split the data for comparisons
cp_var2
The variable to calculate proportions for
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")
cp_levels
The factor level selected for the proportion comparison
cp_alternative
The alternative hypothesis ("two.sided", "greater" or "less")
cp_sig_level
Span of the confidence interval
cp_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_props

Details

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

See Also

summary.compare_props to summarize results

plot.compare_props to plot results

Examples

Run this code
result <- compare_props("titanic", "pclass", "survived")

Run the code above in your browser using DataLab