collinear | R Documentation |

This function identifies predictors with r^2 above a given cut-off and produces an index of predictors to be removed. The function takes a matrix or data.frame of predictors, and the columns need to be ordered in terms of importance - first column of any pair that are correlated is retained and subsequent columns which correlate above the cut-off are flagged for removal.

collinear(x, rsq_cutoff = 0.9, verbose = FALSE)

`x` |
A matrix or data.frame of values. The order of columns is used to
determine which columns to retain, so the columns in |

`rsq_cutoff` |
Value of cut-off for r-squared |

`verbose` |
Boolean whether to print details |

Integer vector of the indices of columns in `x`

to remove due to
collinearity

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.