single_prop {radiant.basics} | R Documentation |
Compare a sample proportion to a population proportion
Description
Compare a sample proportion to a population proportion
Usage
single_prop(
dataset,
var,
lev = "",
comp_value = 0.5,
alternative = "two.sided",
conf_lev = 0.95,
test = "binom",
data_filter = "",
envir = parent.frame()
)
Arguments
dataset |
Dataset |
var |
The variable selected for the proportion comparison |
lev |
The factor level selected for the proportion comparison |
comp_value |
Population value to compare to the sample proportion |
alternative |
The alternative hypothesis ("two.sided", "greater", or "less") |
conf_lev |
Span of the confidence interval |
test |
bionomial exact test ("binom") or Z-test ("z") |
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") |
envir |
Environment to extract data from |
Details
See https://radiant-rstats.github.io/docs/basics/single_prop.html for an example in Radiant
Value
A list of variables used in single_prop as an object of class single_prop
See Also
summary.single_prop
to summarize the results
plot.single_prop
to plot the results
Examples
single_prop(titanic, "survived") %>% str()
single_prop(titanic, "survived", lev = "Yes", comp_value = 0.5, alternative = "less") %>% str()