colinearityScore: Collinearity score

Description Usage Arguments Value Examples

View source: R/misc.R

Description

Collinearity score for a regression model indicating if variables are too highly correlated to give meaningful results

Usage

1

Arguments

fit

regression model fit from lm() or lmer()

Value

Returns the collinearity score between 0 and 1, where a score > 0.999 means the degree of collinearity is too high. This function reports the correlation matrix between coefficient estimates for fixed effects. The collinearity score is the maximum absolute correlation value of this matrix. Note that the values are the correlation between the parameter estimates, and not between the variables themselves.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# load library
# library(variancePartition)

# load simulated data:
data(varPartData)
form <- ~ Age + (1|Individual) + (1|Tissue) 

res <- fitVarPartModel( geneExpr[1:10,], form, info )
 
# evaluate the collinearity score on the first model fit
# this reports the correlation matrix between coefficients estimates
# for fixed effects
# the collinearity score is the maximum absolute correlation value
# If the collinearity score > .999 then the variance partition 
# estimates may be problematic
# In that case, a least one variable should be omitted
colinearityScore(res[[1]])

variancePartition documentation built on Nov. 8, 2020, 5:18 p.m.