Learn R Programming

dirttee (version 1.0.2)

plot.modreg: Plot regression terms for modreg objects

Description

Plots smooth components of a fitted modreg object.

Usage

# S3 method for modreg
plot(x, ...)

Value

The functions main purpose is its side effect of generating plots. It also silently returns a list of the data used to produce the plots, which can be used to generate customized plots.

Arguments

x

The object to plot, must be of class modreg.

...

Additional arguments to pass to plot.gam.

Details

This function is a wrapper for plot.gam. It displays term plots of smoothed variables. Optionally produces term plots for parametric model components as well. Standard errors will not be displayed but can be estimated by boot_modreg.

Examples

Run this code

data(colcancer)
# mode regression with P-splines. Convergence criteria are changed to speed up the function
reg <- modreg(Surv(logfollowup, death) ~ sex + s(age, bs = "ps"), data = colcancer[1:70, ], 
control = modreg.control(tol_opt = 10^-2, tol_opt2 = 10^-2, tol = 10^-3))
plot(reg)


Run the code above in your browser using DataLab