plot.segmented.lme {segmented} | R Documentation |
Plot method for segmented mixed objects
Description
Takes a fitted segmented.lme
object returned by segmented.lme()
and plots (or adds)
the fitted broken-line relationship for the segmented term.
Usage
## S3 method for class 'segmented.lme'
plot(x, level=1, id = NULL, res = TRUE, pop = FALSE, yscale = 1, xscale = 1,
n.plot, pos.leg = "topright", vline = FALSE, lines = TRUE,
by=NULL, add=FALSE, conf.level=0, withI=TRUE, vcov.=NULL, shade=FALSE,
drop.var=NULL, text.leg=NULL, id.name=TRUE, ...)
Arguments
x |
Object of class |
level |
An integer giving the level of grouping to be used when computing the segmented relationship(s). |
id |
A scalar or vector meaning which subjects profiles have to be drawn. If |
res |
If |
pop |
if |
yscale |
If |
xscale |
If |
n.plot |
a vector to be passed to |
pos.leg |
a character ('topright', 'topleft',...) meaning the location of the legend. Set |
vline |
logical, if |
lines |
logical, if |
by |
A named list indicating covariate names and corresponding values affecting the fitted segmented relationship. For instance:
|
add |
If |
conf.level |
The confidence level for pointwise confidence intervals. Effective only if |
withI |
If |
vcov. |
The fixed effects covariance matrix. If |
shade |
If |
drop.var |
Possible coefficient names to be removed before computing the segmented relationship (E.g. the group-specific intercept.). |
text.leg |
If specified (and |
id.name |
If |
... |
additional arguments, such as |
Details
The function plots the 'subject'-specific segmented profiles for the 'subjects' specificed in id
or, if level=0
, the fitted segmented relationship based on fixed effects only. The number of panels to drawn is actually the minimum between length(id)
and prod(n.plot)
, but if n.plot=c(1,1)
(or also simply n.plot=1
), the ‘individual’ profiles will be pictured on the same panel.
Value
A single or multiple (depending on level
and id
) plot showing the fitted segmented profiles.
Warning
All the functions for segmented mixed models (*.segmented.lme) are still at an experimental stage
Note
If by
is specified (and level=0
is set), a legend is also added in the plot reporting covariate(s) name and value affecting the segmented relationship. Set pos.leg=TRUE
to have no legend. On the other hand, use text.leg
to add legend reporting the covariate baseline values.
Author(s)
Vito Muggeo
See Also
Examples
## Not run:
#continues example from segmented.lme
plot(os, yscale=-1) #different y-scales
plot(os2, n.plot=1, l.col=2:6, l.lwd=2) #all segmented profiles on the same plot
## End(Not run)