forked from leaffur/mcvis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
52 lines (31 loc) · 1.55 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
output: github_document
---
# mcvis: visualisation of multicollinearity in data
![R-CMD-check](https://github.com/kevinwang09/mcvis/workflows/R-CMD-check/badge.svg)
[![Codecov test coverage](https://codecov.io/gh/kevinwang09/mcvis/branch/master/graph/badge.svg)](https://codecov.io/gh/kevinwang09/mcvis?branch=master)
<img src="https://github.com/kevinwang09/mcvis/raw/master/inst/mcvis_logo.png" align="right" width="200" />
## Introduction
`mcvis` is a R package for visualising multicollinearity in a data design matrix. The underlying methodology uses resampling techniques to identify groups of variables that causes multicollinearity.
You can learn more about `mcvis` from [this vignette](https://kevinwang09.github.io/mcvis/articles/mcvis.html).
## Installation
`mcvis` can be installed using the `devtools` package.
```{r, eval = FALSE}
devtools::install_github("kevinwang09/mcvis")
```
## A quick example
Using a `mcvis` bipartite plot, variables (bottom row) that cause strong collinearity are visualised as bolded lines connecting with our "tau" statistics (top row).
```{r, warning = FALSE, message = FALSE, cache = TRUE}
library(mcvis)
library(ggplot2)
set.seed(1)
p = 10
n = 100
X = matrix(rnorm(n*p), ncol = p)
## Inducing collinearity into the design matrix
X[,1] = X[,2] + rnorm(n, 0, 0.1)
mcvis_result = mcvis(X)
plot(mcvis_result)
```
# Reference
+ *Lin, C., Wang, K. Y. X., & Mueller, S. (2020). mcvis: A new framework for collinearity discovery, diagnostic and visualization. Journal of Computational and Graphical Statistics, In Press.*