powered by
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() )
A list of all variables used in goodness as an object of class goodness
Dataset
A categorical variable
Hypothesized distribution as a number, fraction, or numeric vector. If unspecified, defaults to an even distribution
Table with frequencies as alternative to dataset
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000")
Environment to extract data from
See https://radiant-rstats.github.io/docs/basics/goodness.html for an example in Radiant
summary.goodness to summarize results
summary.goodness
plot.goodness to plot results
plot.goodness
goodness(newspaper, "Income") %>% str() goodness(newspaper, "Income", p = c(3 / 4, 1 / 4)) %>% str() table(select(newspaper, Income)) %>% goodness(tab = .)
Run the code above in your browser using DataLab