# pc.sel: Variable selection using the PC-simple algorithm In Rfast2: A Collection of Efficient and Extremely Fast R Functions II

 Variable selection using the PC-simple algorithm R Documentation

## Variable selection using the PC-simple algorithm

### Description

Variable selection using the PC-simple algorithm.

### Usage

``````pc.sel(y, x, ystand = TRUE, xstand = TRUE, alpha = 0.05)
``````

### Arguments

 `y` A numerical vector with continuous data. `x` A matrix with numerical data; the independent variables, of which some will probably be selected. `ystand` If this is TRUE the response variable is centered. The mean is subtracted from every value. `xstand` If this is TRUE the independent variables are standardised. `alpha` The significance level.

### Details

Variable selection for continuous data only is performed using the PC-simple algorithm (Buhlmann, Kalisch and Maathuis, 2010). The PC algorithm used to infer the skeleton of a Bayesian Network has been adopted in the context of variable selection. In other words, the PC algorithm is used for a single node.

### Value

A list including:

 `vars` A vector with the selected variables. `n.tests` The number of tests performed. `runtime` The runtime of the algorithm.

### Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

### References

Buhlmann P., Kalisch M. and Maathuis M. H. (2010). Variable selection in high-dimensional linear models: partially faithful distributions and the PC-simple algorithm. Biometrika, 97(2): 261-278. https://arxiv.org/pdf/0906.3204.pdf

``` pc.skel, omp ```

### Examples

``````y <- rnorm(100)
x <- matrix( rnorm(100 * 50), ncol = 50)
a <- pc.sel(y, x)
``````

Rfast2 documentation built on May 29, 2024, 8:45 a.m.