dropvar: Drop variable

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

View source: R/dropvar.R

Description

Drops columns in a matrix to avoid perfect multicollinearity.

Usage

1
dropvar(x, tol=1e-07, LAPACK=FALSE, silent=FALSE)

Arguments

x

a matrix, possibly less than full column rank.

tol

numeric value. The tolerance for detecting linear dependencies among regressors, see qr function. Only used if LAPACK is FALSE

LAPACK

logical, TRUE or FALSE (default). If true use LAPACK otherwise use LINPACK, see qr function

silent

logical, TRUE (default) or FALSE. Whether to print a notification whenever a regressor is removed

Details

Original function drop.coef developed by Rune Haubo B. Christensen in package ordinal, https://cran.r-project.org/package=ordinal.

Value

a matrix whose regressors linearly independent

Author(s)

Rune Haubo B. Christensen, with modifications by Genaro Sucarrat, http://www.sucarrat.net/

References

Rune H.B. Christensen (2014): 'ordinal: Regression Models for Ordinal Data'. https://cran.r-project.org/package=ordinal

See Also

isat

Examples

1
2
3
4
5
6
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

gets documentation built on May 30, 2017, 4:09 a.m.

Search within the gets package
Search all R packages, documentation and source code