ciTest-general: Generic function for conditional independence test

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Generic function for conditional independence test. Specializes to specific types of data.

Usage

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

Arguments

x

An object for which a test for conditional independence is to be made. See 'details' for valid types of x.

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 set.

...

Additional arguments to be passed on to other methods.

Details

x can be 1) a table, 2) a dataframe whose columns are numerics and factors or 3) a list with components cov and n.obs.

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.)

Value

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

Author(s)

Søren Højsgaard, sorenh@math.aau.dk

See Also

ciTest.table, ciTest_table, ciTest.data.frame, ciTest_df, ciTest.list, ciTest_mvn, chisq.test

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## contingency table:
data(reinis)
## dataframe with only numeric variables:
data(carcass)
## dataframe with numeric variables and factors:
data(milkcomp1)

ciTest(cov.wt(carcass, method='ML'), set=~Fat11 + Meat11 + Fat12)
ciTest(reinis, set=~smo + phy + sys)
ciTest(milkcomp1, set=~tre + fat + pro)

boennecd/gRim documentation built on May 12, 2019, 3:10 p.m.