Package 'Mychisq'

Title: Chi-Squared Test for Goodness of Fit and Independence Test
Description: The chi-squared test for goodness of fit and independence test.
Authors: Atchanut Rattanalertnusorn [cre, aut], Jiranan Choojai [aut], Chutima Philadee [aut], Kittipong Klinjan [aut], Issaraporn Thiamsorn [aut]
Maintainer: Atchanut Rattanalertnusorn <[email protected]>
License: GPL-3
Version: 0.1.3
Built: 2025-02-16 04:45:57 UTC
Source: https://github.com/cran/Mychisq

Help Index


Goodness of fit test

Description

This function is the goodness of fit test

Usage

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

Arguments

x

a vector of observed

p

probability of each group

conf.level

confidence level

Value

output for goodness of fit test

References

Chernoff, H.; Lehmann, E. L.(1954) <doi: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)

Independence test

Description

This function is for independence test

Usage

indchisq(O, conf.level = 0.95)

Arguments

O

an observed matrix has a rows and b columns

conf.level

confidence level

Value

output for independence test

References

Plackett, R. L. (1983). <doi:10.2307/1402731>.

Examples

v <- c(80,60,150,50,40,20)
X<- matrix(v,ncol=2,byrow = TRUE)  # 3x2
indchisq(X)

Plot of Chi-squared distribution

Description

The plot of Chi-squared distribution with k degrees of freedom

Usage

plotchisq(df = 8)

Arguments

df

degrees of freedom

Value

The figure of Chi-squared distribution with k degrees of freedom

Examples

plotchisq(df=10)