Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

qgamV

Fit a QGAM model and get a gamViz object


Description

These are wrapper that fits a QGAM model using qgam::qgam and converts it to a gamViz object using the getViz function. It is essentially a shortcut.

Usage

qgamV(form, data, qu, lsig = NULL, err = NULL, aQgam = list(), aViz = list())

Arguments

form, data, qu, lsig, err

same arguments as in qgam::qgam.

aQgam

list of further arguments to be passed to qgam::qgam.

aViz

list of arguments to be passed to getViz.

Value

An object of class "gamViz" which can, for instance, be plotted using plot.gamViz.

Examples

library(mgcViz)
set.seed(2) ## simulate some data...
dat <- gamSim(2,n=1000,dist="normal",scale=0.25)$data

# Fit GAM and get gamViz object
b <- qgamV(y~s(x) + s(z) + I(x*z), data = dat, qu = 0.2,
           aQgam = list(argGam = list(select = TRUE)), aViz = list("nsim" = 0))

# This is equivalent to doing
# 1. Fit QGAM
# b <- qgam(y~s(x) + s(z) + I(x*z), data=dat, qu = 0.2, argGam = list(select = TRUE))
# 2. Convert to gamViz object
# b <- getViz(b, nsim = 0)

# Either way, we all effects by doing
print(plot(b, allTerms = TRUE), pages = 1)

mgcViz

Visualisations for Generalized Additive Models

v0.1.6
GPL-3
Authors
Matteo Fasiolo [aut, cre], Raphael Nedellec [aut], Yannig Goude [ctb], Christian Capezza [ctb], Simon N. Wood [ctb]
Initial release
2020-03-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.