gm.chi {gmvalid} | R Documentation |
Conducts a conditional chi-squared test for the null hypothesis X independent Y given Z.
gm.chi(data, X = 1, Y = 2, Z = 3)
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. |
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)
chi.squared |
Value of the chi-squared statistic. |
DF |
Degrees of freedom. |
p.value |
P-value of the test. |
Ronja Foraita, Fabian Sobotka
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de
Agresti A (1990) Categorial Data Analysis Wiley, New York.
data(dp) gm.chi(dp,1,2,3) gm.chi(dp,2,3,1) gm.chi(dp,1,3,2)