| citest-df {gRim} | R Documentation |
Test for conditional independence in a dataframe
Description
Test for conditional independence in a dataframe.
Usage
ciTest_df(x, set = NULL, ...)
Arguments
x |
A dataframe. |
set |
A specification of the test to be made. The tests are of
the form u and v are independent condionally on S where u and v
are variables and S is a set of variables. See 'details' for
details about specification of |
... |
Additional arguments. |
Details
-
setcan be 1) a vector or 2) a right-hand sided formula in which variables are separated by '+'. In either case, it is tested if the first two variables in thesetare conditionally independent given the remaining variables inset. (Notice an abuse of the '+' operator in the right-hand sided formula: The order of the variables does matter.) If
setisNULLthen it is tested whether the first two variables are conditionally independent given the remaining variables.If
setconsists only of factors thenx[,set]is converted to a contingency table and the test is made in this table usingciTest_table().If
setconsists only of numeric values and integers thenx[,set]is converted to a list with componentscovandn.obsby callingcov.wt(x[,set], method='ML'). This list is then passed on tociTest_mvn()which makes the test.
Value
An object of class citest (which is a list).
Author(s)
Søren Højsgaard, sorenh@math.aau.dk
See Also
ciTest, ciTest_table,
ciTest_mvn, chisq.test
Examples
data(milkcomp1)
ciTest(milkcomp1, set=~tre + fat + pro)
ciTest_df(milkcomp1, set=~tre + fat + pro)