Proportion Test (N Outcomes)
The χ² Goodness of fit test (not to be confused with the χ² test of independence), tests the Null hypothesis that the proportions of observations match some expected proportions. If the p-value is low, this suggests that the Null hypothesis is false, and that the true proportions are different to those tested.
Example usage
Arguments
data | the data as a data frame |
var | the variable of interest in data (not necessary when using a formula, see the examples) |
counts | the counts in data |
expected | TRUE or FALSE (default), whether expected counts should be displayed |
ratio | a vector of numbers: the expected proportions |
Returns
A results object containing:
results$props | a table |
results$tests | a table |
Tables can be converted to data frames with asDF or as.data.frame(). For example:
results$props$asDF
as.data.frame(results$props)