Test for conditional independence in a dataframe

Description

Test for conditional independence in a dataframe.

Usage

1
ciTest_df(x, set = NULL, ...)

Arguments

x

A dataframe.

set
...

Details

set can 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 the set are conditionally independent given the remaining variables in set. (Notice an abuse of the '+' operator in the right-hand sided formula: The order of the variables does matter.)

If set is NULL then it is tested whether the first two variables are conditionally independent given the remaining variables.

If set consists only of factors then x[,set] is converted to a contingency table and the test is made in this table using ciTest_table().

If set consists only of numeric values and integers then x[,set] is converted to a list with components cov and n.obs by calling cov.wt(x[,set], method='ML'). This list is then passed on to ciTest_mvn() which makes the test.

Value

An object of class 'citest' (which is a list).

Author(s)

S<f8>ren H<f8>jsgaard, sorenh@math.aau.dk

See Also

ciTest

ciTest.table ciTest_table

ciTest.list ciTest_mvn

chisq.test

Examples

1
2
3
data(milkcomp1)
ciTest(milkcomp1, set=~tre+fat+pro)
ciTest_df(milkcomp1, set=~tre+fat+pro)