flexCItwd {micd}R Documentation

Wrapper for gaussCItwd, disCItwd and mixCItwd

Description

A plug-in conditional independence test for pcalg::skeleton, pcalg::pc or pcalg::fci when the data contain missing values. Observations where at least one of the variables involved in the test is missing are deleted prior to performing the test (test-wise deletion). The function flexCItwd detects whether variables are continuous, discrete or mixed, and automatically switches between gaussCItwd (continuous only), link{disCItwd} (discrete only) and mixCItwd (mixed).

Usage

flexCItwd(x, y, S = NULL, data)

Arguments

x, y, S

(Integer) position of variable X, Y and set of variables S, respectively, in each correlation matrix in suffStat. It is tested whether X and Y are conditionally independent given the subset S of the remaining variables.

data

A data frame

Value

A p-value

Examples

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

## delete some observations
set.seed(123)
dat[sample(400, 20), 2] <- NA
dat[sample(400, 30), 4] <- NA

## obtain correct input 'suffStat' for 'flexMItest'
suff <- getSuff(imp, test="flexCItwd")

## analyse data
# continuous variables only
flexCItwd(4, 5, NULL, dat)

# discrete variables only
flexCItwd(2, 3, NULL, dat)

# mixed variables
flexCItwd(2, 3, 4, dat)


[Package micd version 1.1.1 Index]