csf: Generate output for a Chi Square Test for Goodness of Fit

Description Usage Arguments Value Examples

View source: R/csf.R

Description

This function performs a Chi Sqare test for Goodness of Fit on one factor and returns reporting information on the model.

Usage

1
csf(x, y = NULL, probs = NULL)

Arguments

x

A formula ~Categorical Variable .

y

A data frame, necessary if data frame is not referenced in formula or piped in.

probs

A vector to test goodness of fit, must have same number of categories and add to 1 if percentages

Value

A list of output for reporting $analysis_type, $results, $fit_model, $observed, $expected, $standardized_residuals, $contribution, $table_percentages

Examples

1
2
3
4
5
x2_results <- x2_data %>% csf(~class_rank)
x2_results <- x2_data %>% csf(~class_rank,probs = c(500,147,24,39,111))
x2_results <- x2_data %>% csf(~class_rank,probs = c(.61, .18, .03, .05, .13))
x2_results <- csf(x2_data$class_rank)
x2_results <- csf(x2_data$class_rank,probs = c(500,147,24,39,111))

ECO230/eco230r documentation built on May 12, 2020, 2:10 a.m.