achisq.stat {DCluster}R Documentation

Another implementation of Pearson's Chi-square statistic

Description

Compute Pearson's Chi-square statistic. See achisq manual page for more details.

Usage

achisq.stat(data, lambda=NULL)

Arguments

data A dataframe containing the data, as specified in the DClustermanpage.
lambda The value of the relative risks under the null hypotheses. If its NULL, the second hypotheses commented above is considered and the expected number of cases will automatically be corrected.

Value

A list with three components

T The value of the statistic.
df Degrees of freedom of the asinthotic Chi-square distribution.
pvalue Related pvalue.

References

Potthoff, R. F. and Whittinghill, M.(1966). Testing for Homogeneity: I. The Binomial and Multinomial Distributions. Biometrika 53, 167-182.

Potthoff, R. F. and Whittinghill, M.(1966). Testing for Homogeneity: The Poisson Distribution. Biometrika 53, 183-190.

See Also

DCluster, achisq, achisq.boot, achisq.pboot

Examples

library(spdep)

data(nc.sids)

sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))

#Compute the statistic under the assumption that lambda = 1.
achisq.stat(sids, lambda=1)

[Package DCluster version 0.1-5 Index]