View source: R/gets-base-source.R
dropvar | R Documentation |
Drops columns in a matrix to avoid perfect multicollinearity.
dropvar(x, tol=1e-07, LAPACK=FALSE, silent=FALSE)
x |
a matrix, possibly less than full column rank. |
tol |
numeric value. The tolerance for detecting linear dependencies among regressors, see |
LAPACK |
logical, TRUE or FALSE (default). If true use LAPACK otherwise use LINPACK, see |
silent |
logical, TRUE (default) or FALSE. Whether to print a notification whenever a regressor is removed |
Original function drop.coef
developed by Rune Haubo B. Christensen in package ordinal
, https://cran.r-project.org/package=ordinal.
a matrix whose regressors linearly independent
Rune Haubo B. Christensen, with modifications by Genaro Sucarrat, http://www.sucarrat.net/
Rune H.B. Christensen (2014): 'ordinal: Regression Models for Ordinal Data'. https://cran.r-project.org/package=ordinal
isat
set.seed(1)
x <- matrix(rnorm(20), 5)
dropvar(x) #full rank, none are dropped
x[,4] <- x[,1]*2
dropvar(x) #less than full rank, last column dropped
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.