Type: | Package |
Title: | Chi-Squared Test for Goodness of Fit and Independence Test |
Version: | 0.1.3 |
Language: | en-US |
Maintainer: | Atchanut Rattanalertnusorn <atchanut_r@rmutt.ac.th> |
Description: | The chi-squared test for goodness of fit and independence test. |
License: | GPL-3 |
Encoding: | UTF-8 |
Imports: | stats,graphics |
RoxygenNote: | 7.1.2 |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
NeedsCompilation: | no |
Packaged: | 2022-03-16 10:03:34 UTC; COM |
Author: | Atchanut Rattanalertnusorn [cre, aut], Jiranan Choojai [aut], Chutima Philadee [aut], Kittipong Klinjan [aut], Issaraporn Thiamsorn [aut] |
Repository: | CRAN |
Date/Publication: | 2022-03-16 11:10:02 UTC |
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)