Learn R Programming

sme (version 1.0.2)

plotSmeModel: Visualisation of a fitted smoothing-splines mixed-effects model

Description

The observations used to fit the given smoothing-splines mixed-effects model are shown as a scatter plot and the fitted mean curve is overlaid. Optionally, the fitted individual curves are also shown. Also, the 95% confidence band for the fitted mean curve can optionally be displayed.

Usage

plotSmeModel(x,xlab="Time",ylab="Y",showIndividuals=T,showConfidenceBands=F,
col.meanCurve="red",...)

Arguments

x

an object inheriting from class sme, representing a fitted smoothing-splines mixed-effects model

xlab

the label for the x-axis, defaulting to "Time"

ylab

the label for the y-axis, defaulting to "Y"

showIndividuals

if TRUE then each of the fitted subject specific curves will be displayed in the plot as dashed lines, otherwise only the mean curve will be shown

showConfidenceBands

if TRUE, then the 95% confidence band for the fitted mean curve will be shown

col.meanCurve

the color to be used for the fitted mean curve and, if showConfidenceBands is TRUE, the confidence band as well

additional arguments passed through to plot when producing the scatter plot of observations

Value

A plot visualising the fitted smoothing-splines mixed-effects model as described above.

References

Berk, M. (2012). Smoothing-splines Mixed-effects Models in R. Preprint

See Also

plot.sme, plotSmeRaw, plotSmeDiagnostic

Examples

Run this code
# NOT RUN {
  data(MTB)
  fit <- sme(MTB[MTB$variable==6031,c("y","tme","ind")])
  plotSmeModel(fit,showIndividuals=FALSE)
  plotSmeModel(fit,showConfidenceBands=TRUE)
# }

Run the code above in your browser using DataLab