gofchisq: Goodness of fit test

View source: R/gofchisq.R

gofchisqR Documentation

Goodness of fit test

Description

This function is for the goodness of fit test of one categorical variable

Usage

gofchisq(x, p, conf.level = 0.95)

Arguments

x

an observed frequency vector

p

probability of each group

conf.level

confidence level for testing hypothesis, default is 0.95, user can change to 0.90 or otherwise

Value

output for the goodness of fit test

References

Chernoff, H. and Lehmann, E.L. (1954) The Use of Maximum Likelihood Estimates in Chi-Square Tests for Goodness of Fit. Annals of Mathematical Statistics, 25, 579-586. <doi.org/10.1214/aoms/1177728726>.

Examples

x=c(12,9,10,7,12)
prob=c(1/5,1/5,1/5,1/5,1/5)  #1:1:1:1:1
gofchisq(x=x,p=prob)


Mychisq documentation built on June 22, 2026, 9:08 a.m.

Related to gofchisq in Mychisq...