Description Usage Arguments Value Examples
This function takes a fitted mgcv model object and returns a data frame of variance inflation factors
1 | vif.gam(object)
|
object |
An object of class gam |
VIF.df A data frame consisting of the VIF values for each parametric term in a fitted Generalised Additive Model
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(mgcv)
library(dplyr)
set.seed(101)
N <- 100
x1 <- runif(n=N)
x2 <- runif(n=N)
x3 <- runif(n=N) + 0.9*x1 - 1.75*x2
df <- data.frame(x1 = x1,
x2 = x2,
x3 = x3) %>%
mutate(y = rnorm(n=N,
mean = 1 - 2*x1 + 3*x2 - 0.5*x3,
sd = 0.5))
fit1 <- gam(data=df, y ~ x1 + x2 + x3)
summary(fit1)
vif.gam(fit1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.