Learn R Programming

radiant (version 0.1.95)

single_prop: Compare a sample proportion to a population proportion

Description

Compare a sample proportion to a population proportion

Usage

single_prop(dataset, sp_var, data_filter = "", sp_levels = "", sp_comp_value = 0.5, sp_alternative = "two.sided", sp_sig_level = 0.95)

Arguments

dataset
Dataset name (string). This can be a dataframe in the global environment or an element in an r_data list from Radiant
sp_var
The variable selected for the proportion comparison
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")
sp_levels
The factor level selected for the proportion comparison
sp_comp_value
Population value to compare to the sample proportion
sp_alternative
The alternative hypothesis ("two.sided", "greater", or "less")
sp_sig_level
Span of the confidence interval

Value

A list of variables used in single_prop as an object of class single_prop

Details

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

See Also

summary.single_prop to summarize the results

plot.single_prop to plot the results

Examples

Run this code
result <- single_prop("diamonds","clarity", sp_levels = "IF", sp_comp_value = 0.05)

Run the code above in your browser using DataLab