flexCItwd | R Documentation |
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).
flexCItwd(x, y, S = NULL, data)
x, y, S |
(Integer) position of variable X, Y and set of variables S,
respectively, in each correlation matrix in |
data |
A data frame |
A p-value
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.