Learn R Programming

collin

Collinearity can be a problem in regression models. When examining the effects of an exposure at different time points, constrained distributed lag models (https://CRAN.R-project.org/package=dlnm) can alleviate some of the problems caused by collinearity. Still, some consequences of collinearity may remain and they are often unexplored. This package is a tool to assess whether unexpected results of a study could be influenced by collinearity. Essentially, the package provides a graphical comparison of the effects estimated in the real analysis with the effects estimates that would be obtained in a scenario with an alternative true pattern effect for the association of interest. The package can be also applied to regression models that do not include a distributed lag structure.

Getting started

  • The last version released on CRAN can be installed within an R session by executing:
install.packages("collin")
  • The package collin is available on the Comprehensive R Archive Network (CRAN), with info at the related web page https://CRAN.R-project.org/package=collin.

  • Once the package has been installed, a summary of the main functions is available by executing:

help(collin)
  • A comprehensive tutorial, including a number of detailed examples, is available by executing:
vignette("collin")

References

The methodology used in the package is described in

  • Basagaña X, Barrera-Gómez J. Reflection on modern methods: visualizing the effects of collinearity in distributed lag models. International Journal of Epidemiology. 2021;51(1):334-344. DOI: 10.1093/ije/dyab179. URL: https://academic.oup.com/ije/article/51/1/334/6359467

Copy Link

Version

Install

install.packages('collin')

Monthly Downloads

202

Version

0.0.4

License

GPL-3

Maintainer

Jose Barrera-Gomez

Last Published

September 19th, 2023

Functions in collin (0.0.4)

lagpad

Function to get a vector lagged.
rpoisod

Internal function to generate random numbers following over-dispersed Poisson distribution based on simple cheat of using a standard negative binomial, but choosing the scale parameter to give the desired mean vs variance ratio at the given value of the mean. Taken from: https://stat.ethz.ch/pipermail/r-help/2002-June/022425.html
plot.collindlnmnonlinear

Visualize effects of collinearity in distributed lag model under an hypothetical non-linear effect pattern.
rod

Internal function to generate random numbers following over-dispersed Bernoulli or Poisson distribution. It wraps rpoisod and rbinomod functions.
collindlnm

Simulates effects from a distributed lag model pattern.
plot.collindlnmlinear

Visualizes effects of collinearity in distributed lag model under an hypothetical linear effect pattern.
simulatedlnm

simulatedllm generic.
rhospno2

Respiratory hospital admissions and air pollution.
rbinomod

Internal function to generate random numbers following over-dispersed Bernoulli distribution, based in the BetaBinomial distribution. It currently does not work and standard Bernoulli distribution is actually used instead.
collin-package

collin: Visualization the Effects of Collinearity in Distributed Lag Models and Other Linear Models
mempm25

Working memory test scores and air pollution.