gaussCItwd | R Documentation |
A wrapper for pcalg::gaussCItest
,
to be used within 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).
gaussCItwd(x, y, S = NULL, suffStat)
x, y, S |
(integer) position of variable X, Y and set of variables S,
respectively, in each correlation matrix in |
suffStat |
|
See pcalg::gaussCItest
for details on
Fisher's z-test. Test-wise deletion is valid if missingness does not jointly
depend on X and Y.
A p-value.
pcalg::condIndFisherZ()
for complete data, gaussCItestMI()
for multiply imputed data
## load data (numeric variables) dat <- as.matrix(windspeed) ## delete some observations set.seed(123) dat[sample(1:length(dat), 260)] <- NA ## analyse data # complete data: suffcomplete <- getSuff(windspeed, test="gaussCItest") gaussCItest(1, 2, c(4,5), suffStat = suffcomplete) # test-wise deletion: ========== gaussCItwd(1, 2, c(4,5), suffStat = dat) # list-wise deletion: ========== sufflwd <- getSuff(dat[complete.cases(dat), ], test="gaussCItest") gaussCItest(1, 2, c(4,5), suffStat = sufflwd) ## use gaussCItwd within pcalg::pc pc.fit <- pc(suffStat = dat, indepTest = gaussCItwd, alpha = 0.01, p = 6) pc.fit
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.