View source: R/vis_concurvity.R
vis_concurvity | R Documentation |
Plot measures of how much one term in the model could be explained by another. When values are high, one should consider re-running variable selection with one of the offending variables removed to check for stability in term selection.
vis_concurvity(model, type = "estimate")
model |
fitted model |
type |
concurvity measure to plot, see |
These methods are considered somewhat experimental at this time. Consult
concurvity
for more information on how concurvity
measures are calculated.
David L Miller
# example from ?concurvity
library(mgcv)
## simulate data with concurvity...
set.seed(8);n<- 200
f2 <- function(x) 0.2 * x^11 * (10 * (1 - x))^6 + 10 *
(10 * x)^3 * (1 - x)^10
t <- sort(runif(n)) ## first covariate
## make covariate x a smooth function of t + noise...
x <- f2(t) + rnorm(n)*3
## simulate response dependent on t and x...
y <- sin(4*pi*t) + exp(x/20) + rnorm(n)*.3
## fit model...
b <- gam(y ~ s(t,k=15) + s(x,k=15),method="REML")
## assess concurvity between each term and `rest of model'...
vis_concurvity(b)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.