| pc | R Documentation |
This is a wrapper function for the pc function as
implemented in the pcalg package. All computations are carried out by the
pcalg package.
pc(
data = NULL,
sparsity = 10^(-1),
test = regTest,
suffStat = NULL,
method = "stable.fast",
methodNA = "none",
methodOri = "conservative",
output = "cpdag",
varnames = NULL,
conservative = TRUE,
...
)
data |
A data.frame with data. All variables should be assigned to exactly one period by prefixing them with the period name (see example below). |
sparsity |
The sparsity level to be used for independence testing (i.e. significance level threshold to use for each test). |
test |
A procedure for testing conditional independence.
The default, |
suffStat |
Sufficient statistic. If this argument is supplied, the sufficient statistic is not computed from the inputted data. The format and contents of the sufficient statistic depends on which test is being used. |
method |
Which method to use for skeleton construction, must be
|
methodNA |
Method for handling missing information ( |
methodOri |
Method for handling conflicting separating sets when orienting
edges, must be one of |
output |
One of |
varnames |
A character vector of variable names. It only needs to be supplied
if the |
conservative |
Logital, if |
... |
Further optional arguments which are passed to
|
Note that all independence test procedures implemented
in the pcalg package may be used, see pc.
The methods for handling missing information require that the data,
rather than the suffStat argument is used for inputting data; the latter
assumes no missing information and hence always sets methodNA = "none".
If the test is corTest, test-wise deletion is performed when computing the
sufficient statistic (correlation matrix) (so for each pair of variables, only
complete cases are used). If the test is regTest, test-wise deletion
is performed for each conditional independence test instead.
A tpdag or tskeleton object. Both return types are
S3 objects, i.e., lists with entries: $amat (the estimated adjacency
matrix), $order (character vector with the order, as inputted to
this function), $psi (the significance level used for testing), and
$ntests (the number of tests conducted).
# PC on included example data, use sparsity psi = 0.01, default test (regression-based
#information loss):
data(tpcExample)
pc(tpcExample, sparsity = 0.01)
# PC on included example data, use sparsity psi = 0.01, use test for vanishing partial
# correlations:
data(tpcExample)
pc(tpcExample, sparsity = 0.01, test = corTest)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.