chi.gof2 | R Documentation |
Goodness of Fit Test for Poisson/Binomial from a Frequency Table
chi.gof2(tab, para, para2, dist = "pois", mc1, mc2, alp = 0.05, dig = 2, dig2 = 4)
tab |
Table of frequency |
para |
First parameter (Poisson: mean, Binomial: sample size) |
para2 |
Second parameter (Poisson: none, Binomial: probability) |
dist |
Distribution name ('pois' or 'binom'), Default: 'pois' |
mc1 |
Sequential column numbers to merge (first set, lower side) |
mc2 |
Sequential column numbers to merge (second set, upper side) |
alp |
Level of significance, Default: 0.05 |
dig |
Number of digits below the decimal point for the table, Default: 2 |
dig2 |
Number of digits below the decimal point for the results, Default: 4 |
list(stat=test stat, df=degree of freedom, crv=critical value, pv=p-value, tab=table)
# Goodness-of-fit Test (Poisson/Binomial) set.seed(1234) x=rpois(100,5) mytab=table(x) chi.gof2(mytab, 5) chi.gof2(mytab) chi.gof2(mytab, 10, 0.5, dist="binom") chi.gof2(mytab, 10, dist="binom") chi.gof2(mytab, mc1=8:9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.