Learn R Programming

sme (version 1.0.2)

plotSmeRaw: Visualisation of raw data for a smoothing-splines mixed-effects model

Description

A visualisation of the raw data used to fit the smoothing-splines mixed-effects model is obtained. This is presented as a trellis plot where each panel shows the observations for one of the subjects as a scatter plot (with optional lines connecting the observations if showRawLines is TRUE). If showModelFits is TRUE, then these observations are overlaid with the fitted individual curve for that subject.

Usage

plotSmeRaw(x,xlab="Time",ylab="Y",mainTitle="",showModelFits=TRUE,showRawLines=FALSE,...)

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"

mainTitle

the main title for the plot, defaulting to none

showModelFits

if TRUE, the fitted individual curve for each subject will be overlaid on their observations in their panel

showRawLines

if TRUE, the raw observations will be connected by lines

additional arguments passed through to xyplot

Value

A trellis plot as described above.

References

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

See Also

plot.sme, plotSmeModel, plotSmeDiagnostic

Examples

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

Run the code above in your browser using DataLab