View source: R/variable_selection_algortihms.R

Variable selection using the PC-simple algorithm | R Documentation |

Variable selection using the PC-simple algorithm.

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

`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. |

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.

A list including:

`vars` |
A vector with the selected variables. |

`n.tests` |
The number of tests performed. |

`runtime` |
The runtime of the algorithm. |

Michail Tsagris.

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

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
```

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.