mixMItest | R Documentation |
A modified version of mixCItest
, to be used within pcalg::skeleton
,
pcalg::pc
or pcalg::fci
when multiply imputed data sets are available.
mixMItest(x, y, S = NULL, suffStat, moreOutput = FALSE)
x, y, S |
(integer) position of variable X, Y and set of variables S,
respectively, in |
suffStat |
A list of |
moreOutput |
(only for mixed of discrete variables) If |
See mixCItest
for details on the assumptions of the
Conditional Gaussian likelihood ratio test. CGtestMI
applies this test
to each data.frame
in suffStat
, then combines the results using
the rules in Meng & Rubin (1992).
A p-value. If moreOutput=TRUE
, the test statistic, its main
components and the degrees of freedom are returned as well.
Janine Witte
Meng X.-L., Rubin D.B. (1992): Performing likelihood ratio tests with multiply imputed data sets. Biometrika 79(1):103-111.
## load data (numeric and factor variables) data(toenail2) dat <- toenail2[1:1000, ] ## delete some observations set.seed(123) dat[sample(1000, 20), 2] <- NA dat[sample(1000, 30), 4] <- NA ## impute missing values using random forests (because of run time we just impute 2 chains) imp <- mice(dat, method = "rf", m = 2, printFlag = FALSE) ## analyse data # complete data: mixCItest(2, 3, 5, suffStat = toenail2[1:1000, ]) # multiple imputation: suffMI <- complete(imp, action = "all") mixMItest(2, 3, 5, suffStat = suffMI) # test-wise deletion: mixCItwd(2, 3, 5, suffStat = dat) # list-wise deletion: sufflwd <- dat[complete.cases(dat), ] mixCItest(2, 3, 5, suffStat = sufflwd) ## use mixMItest within pcalg::pc pc.fit <- pc(suffStat = suffMI, indepTest = mixMItest, alpha = 0.01, p = 5) pc.fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.