chi.gof2: Goodness of Fit Test for Poisson/Binomial

Description Usage Arguments Value Examples

Description

Goodness of Fit Test for Poisson/Binomial from a Frequency Table

Usage

1
2
chi.gof2(tab, para, para2, dist = "pois", mc1, mc2, alp = 0.05,
  dig = 2, dig2 = 4)

Arguments

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

Value

list(stat=test stat, df=degree of freedom, crv=critical value, pv=p-value, tab=table)

Examples

1
2
3
4
5
6
7
8
9
# 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)

tjssu/Rstat documentation built on Aug. 8, 2020, 12:38 p.m.