gm.chi {gmvalid}R Documentation

Conditional chi-squared test

Description

Conducts a conditional chi-squared test for the null hypothesis X independent Y given Z.

Usage

gm.chi(data, X = 1, Y = 2, Z = 3)

Arguments

data Data frame or a table (array). Variables should have names, data has to be discrete.
X Number of column of the first variable in data.
Y Number of column of the second variable in data.
Z Number of column of the variable in condition in data.

Details

The conditional chi-squared test is conducted like a marginal chi-squared test where the expected cell counts are calculated as: E(i,j,k) = E(i,+,k)*E(+,j,k)/E(+,+,k)

Value

chi.squared Value of the chi-squared statistic.
DF Degrees of freedom.
p.value P-value of the test.

Author(s)

Ronja Foraita, Fabian Sobotka
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de

References

Agresti A (1990) Categorial Data Analysis Wiley, New York.

See Also

gm.gamma, chisq.test

Examples

  data(dp)
  gm.chi(dp,1,2,3)
  gm.chi(dp,2,3,1)
  gm.chi(dp,1,3,2)

[Package gmvalid version 1.2 Index]