Plot of lmmspline object

Share:

Description

Plots the raw data, the mean and the fitted or derivative information of the lmmspline object.

Usage

1
2
## S3 method for class 'lmmspline'
plot(x, y, data, time, smooth, mean, ...)

Arguments

x

An object of class lmmspline.

y

character or numeric value. Determining which feature should be plotted can be either the index or the name of the feature.

data

alternative matrix or data.frame containing the original data for visualisation purposes.

time

alternative numeric indicating the sample time point. Vector of same length as row length of data for visualisation purposes.

smooth

an optional logical value. Default FALSE, if TRUE smooth representation of the fitted values.

mean

alternative logical if the mean should be displayed. By default set to TRUE.

...

Additional arguments which are passed to plot.

Value

plot showing raw data, mean profile and fitted profile.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 
data(kidneySimTimeGroup)
# running for samples in group 1
G1 <- which(kidneySimTimeGroup$group=="G1")
testLmmspline <- lmmSpline(data=kidneySimTimeGroup$data[G1,],
                 time=kidneySimTimeGroup$time[G1],
                 sampleID=kidneySimTimeGroup$sampleID[G1],keepModels=T)
                 
         
plot(testLmmspline, y=2)
plot(testLmmspline, y=2, smooth=TRUE)
# Don't keep the models to improve memory usage 
testLmmspline <- lmmSpline(data=kidneySimTimeGroup$data[G1,],
                 time=kidneySimTimeGroup$time[G1],
                 sampleID=kidneySimTimeGroup$sampleID[G1],keepModels=F)
                 
#plot only the fitted values
plot(testLmmspline, y=2)
#plot fitted values with original data
plot(testLmmspline, y=2, data=kidneySimTimeGroup$data[G1,], time=kidneySimTimeGroup$time[G1])


## End(Not run)