flexCItest: Wrapper for gaussCItest, disCItest and mixCItest

View source: R/flexCItest.R

flexCItestR Documentation

Wrapper for gaussCItest, disCItest and mixCItest

Description

A plug-in conditional independence test for pcalg::skeleton(), pcalg::pc() or pcalg::fci() when multiply imputed data sets are available. flexCItest() detects whether variables are continuous, discrete or mixed, and automatically switches between pcalg::gaussCItest() (continuous only), pcalg::disCItest() (discrete only) and mixCItest() (mixed variables).

Usage

flexCItest(x, y, S = NULL, suffStat)

Arguments

x, y, S

(integer) position of variable X, Y and set of variables S, respectively, in the dataset. It is tested whether X and Y are conditionally independent given the subset S of the remaining variables.

suffStat

a list generated using getSuff() with test="flexMItest". See below for details.

Details

suffStat needs to be a list with four elements named datlist, corlist, conpos and dispos. datlist is the list of imputed datasets. corlist is a list with M+1 elements, where M is the number of imputed datasets. For i=1,...,M, the the i-th element of corlist is the correlation matrix of the continuous variables in the i-th imputed dataset; the (M+1)-the element is the number of rows in each imputed dataset. conpos is a vector containing the integer positions of the continuous variables in the original dataset. dispos is a vector containing the integer positions of the discrete variables in the original dataset.

Value

A p-value.

See Also

pcalg::gaussCItest(), pcalg::disCItest() and mixCItest().

Examples

# load data (numeric and factor variables)
dat <- toenail2[1:400, ]

# obtain correct input 'suffStat' for 'flexCItest'
suff <- getSuff(dat, test="flexCItest")

flexCItest(2,3,NULL, suffStat = suff)


micd documentation built on Nov. 5, 2025, 7:37 p.m.

Related to flexCItest in micd...