infer_chisq_gof_test: Chi Square Goodness of Fit Test

Description Usage Arguments Value Deprecated Function References See Also Examples

View source: R/infer-chisq-gof-test.R

Description

Test whether the observed proportions for a categorical variable differ from hypothesized proportions

Usage

1
infer_chisq_gof_test(data, x, y, correct = FALSE)

Arguments

data

a data.frame or tibble

x

factor; column in data

y

expected proportions

correct

logical; if TRUE continuity correction is applied

Value

infer_chisq_gof_test returns an object of class "infer_chisq_gof_test". An object of class "infer_chisq_gof_test" is a list containing the following components:

chisquare

chi square statistic

pvalue

p-value

df

chi square degrees of freedom

ssize

number of observations

names

levels of x

level

number of levels of x

obs

observed frequency/proportion

exp

expected frequency/proportion

deviation

deviation of observed from frequency

std

standardized residuals

varname

name of categorical variable

Deprecated Function

chisq_gof() has been deprecated. Instead use infer_chisq_gof_test()

References

Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.

See Also

chisq.test

Examples

1
2
3
4
infer_chisq_gof_test(hsb, race, c(20, 20, 20, 140))

# apply continuity correction
infer_chisq_gof_test(hsb, race, c(20, 20, 20, 140), correct = TRUE)

inferr documentation built on May 2, 2019, 6:23 a.m.