Missing-value Fisher-z test
Perform a testwise-deletion Fisher-z independence test to data sets with missing values. With testwise-deletion, the test makes use of all data points that do not have missing values for the variables involved in the test.
Usage
from causallearn.utils.cit import CIT
mv_fisherz_obj = CIT(data_with_missingness, "mv_fisherz") # construct a CIT instance with data and method name
pValue = mv_fisherz_obj(X, Y, S)
Please be kindly informed that we have refactored the independence tests from functions to classes since the release v0.1.2.8. Speed gain and a more flexible parameters specification are enabled.
For users, you may need to adjust your codes accordingly. Specifically, if you are
running a constraint-based algorithm from end to end: then you don’t need to change anything. Old codes are still compatible. For example,
from causallearn.search.ConstraintBased.PC import pc
from causallearn.utils.cit import mv_fisherz
cg = pc(data_with_missingness, 0.05, mv_fisherz)
explicitly calculating the p-value of a test: then you need to declare the
mv_fisherz_obj
and then call it as above, instead of usingmv_fisherz(data, X, Y, condition_set)
as before. Note that nowcausallearn.utils.cit.mv_fisherz
is a string"mv_fisherz"
, instead of a function.
Please see CIT.py for more details on the implementation of the (conditional) independent tests.
Parameters
data: numpy.ndarray, shape (n_samples, n_features). Data, where n_samples is the number of samples and n_features is the number of features.
method: string, “mv_fisherz”.
kwargs: e.g., cache_path
. See Advanced Usages.
Returns
p: the p-value of the test.