goodness | R Documentation |
Evaluate if sample data for a categorical variable is consistent with a hypothesized distribution
goodness(
dataset,
var,
p = NULL,
tab = NULL,
data_filter = "",
envir = parent.frame()
)
dataset |
Dataset |
var |
A categorical variable |
p |
Hypothesized distribution as a number, fraction, or numeric vector. If unspecified, defaults to an even distribution |
tab |
Table with frequencies as alternative to dataset |
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 |
See https://radiant-rstats.github.io/docs/basics/goodness.html for an example in Radiant
A list of all variables used in goodness as an object of class goodness
summary.goodness
to summarize results
plot.goodness
to plot results
goodness(newspaper, "Income") %>% str()
goodness(newspaper, "Income", p = c(3 / 4, 1 / 4)) %>% str()
table(select(newspaper, Income)) %>% goodness(tab = .)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.