cr.gof: The Cressie-Read test for given probabilities

View source: R/cr.gof.R

cr.gofR Documentation

The Cressie-Read test for given probabilities

Description

Computes D-squared Cressie-Read test for given probabilities.

Usage

cr.gof(x, lambda=2/3, p=rep(1/length(x), length(x)))

Arguments

x

a numeric vector of values.

lambda

lambda parameter lambda test Cressie-Read.

p

probabilities.

Details

Statistics Cressie-Read:

D = 2/(lambda*(lambda+1)) * sum( O * ((O/np)^lambda - 1) )

> O - the number of observed

> np - n*p

Lambda parameter to be different from 0, and -1.

> lambda= 1 (Pearson test)

> lambda= -2 (Neyman's modified Pearson test)

> lambda~ 0, lambda is close to 0 (Likelihood Ratio test)

> lambda~ -1 lambda is close to -1 (Kullback-Leibler modified Likelihood Ratio test)

> lambda= -1/2 (Freeman-Tukey's test)

Value

An object of class "htest" containing the following components:

parameter

the degrees of freedom and lambda parameter

statistic

statistic test value

p.value

p-value

Author(s)

Krzysztof Trajkowski

References

Noel Cressie and Timothy R. C. Read (1984). Multinomial Goodness-of-Fit Test. Journal of the Royal Statistical Society. Series B (Methodological), Vol. 46, No. 3 (1984), 440-464.

See Also

chisq.test

Examples

# data:
s <- c(12,15,20,25,17,28)
p <- 1/6
n <- sum(s)*p
np <- n*p
# Cressie-Read:
cr.gof(s)

# Pearson:
cr.gof(s,lambda=1)

krzysiektr/CressieReadTest documentation built on April 3, 2024, 11:01 p.m.