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

plot.random.effect

Plotting random effects


Description

This is the plotting method for random effects (simple random intercepts).

Usage

## S3 method for class 'multi.random.effect'
plot(x, trans = identity, ...)

## S3 method for class 'random.effect'
plot(x, trans = identity, ...)

Arguments

x

a random effect object, extracted using mgcViz::sm.

trans

monotonic function to apply to the fit, confidence intervals and residuals, before plotting. Monotonicity is not checked.

...

currently unused.

Value

An object of class plotSmooth.

Examples

library(mgcViz)
b <- gam(travel~s(Rail,bs="re"), data=Rail, method="REML")
b <- getViz(b)
plot(sm(b, 1)) + l_fitLine(colour = 2, linetype = 2) + l_points() + 
  l_ciLine(colour = 4, linetype = 3)

plot(sm(b, 1)) + l_ciPoly() + l_points()

# Default
plot(b)

###
# Quantile GAM version
###
b <- mqgamV(travel~s(Rail,bs="re"), data=as.data.frame(Rail), qu = c(0.2, 0.4, 0.6, 0.8))

plot(sm(b, 1)) + l_ciPoly() + l_points()

# Default
plot(b)

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.