pcSelect.presel: Estimate Subgraph around a Response Variable using...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/pcalg.R

Description

This function uses pcSelect to preselect some covariates and then runs pcSelect again on the reduced data set.

Usage

1
2
pcSelect.presel(y, dm, alpha, alphapre, corMethod = "standard",
                verbose = 0, directed=FALSE)

Arguments

y

Response vector.

dm

Data matrix (rows: samples, cols: nodes; i.e., length(y) == nrow(dm)).

alpha

Significance level of individual partial correlation tests.

alphapre

Significance level for pcSelect in preselection

corMethod

"standard" or "Qn" for standard or robust correlation estimation

verbose

0-no output, 1-small output, 2-details (using 1 and 2 makes the function very much slower)

directed

Logical; should the output graph be directed?

Details

First, pcSelect is run using alphapre. Then, only the important variables are kept and pcSelect is run on them again.

Value

pcs

Logical vector indicating which column of dm is associated with y

zMin

The minimal z-values when testing partial correlations between y and each column of dm. The larger the number, the more consistent is the edge with the data.

Xnew

Preselected Variables.

Author(s)

Philipp Ruetimann

See Also

pcSelect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
p <- 10
## generate and draw random DAG :
set.seed(101)
myDAG <- randomDAG(p, prob = 0.2)
if(require(Rgraphviz))
   plot(myDAG, main = "randomDAG(10, prob = 0.2)")

## generate 1000 samples of DAG using standard normal error distribution
n <- 1000
d.mat <- rmvDAG(n, myDAG, errDist = "normal")

## let's pretend that the 10th column is the response and the first 9
## columns are explanatory variable. Which of the first 9 variables
## "cause" the tenth variable?
y <- d.mat[,10]
dm <- d.mat[,-10]
res <- pcSelect.presel(d.mat[,10], d.mat[,-10], alpha=0.05, alphapre=0.6)

pcalg documentation built on June 5, 2018, 1:05 a.m.