Usage
"plot"(x, opt = "dv", labels, apv = FALSE, xfun = NULL, yfun = NULL, subset = NULL, ns = 101, abc = NULL, add = FALSE, nlme = FALSE, ...)
"lines"(x, ...)
Arguments
opt
character string containing a subset of letters corresponding to
the options: 'd' for fitted Distance curve, 'v' for fitted Velocity curve,
'e' for fitted fixed Effects distance curve, 'D' for individual fitted
Distance curves, 'V' for individual fitted Velocity curves, 'u' for
Unadjusted individual growth curves, and 'a' for Adjusted individual growth
curves. Options 'dveDV' give spline curves, while 'ua' give data curves made
up as line segments. If both distance and velocity curves are specified, the
axis for the velocity curve appears on the right side of the plot (y2), and
a legend identifying the distance and velocity curves is provided.
labels
optional character vector containing plot labels for x
,
y
and y
velocity from the original SITAR model. The first two
elements can alternatively be provided via par
parameters
xlab
and ylab
, and the third element via y2par
(see
Details). Default labels are the names of x
and y
, and
"y
velocity", suitably adjusted to reflect any back-transformation
via xfun
and yfun
. apv
optional logical specifying whether or not to calculate the age
at peak velocity from the velocity curve. If TRUE, age at peak velocity is
calculated as the age when the second derivative of the fitted curve changes
sign (after applying xfun
and/or yfun
). Age at peak velocity
is marked in the plot with a vertical dotted line, and its value, along with
peak velocity, is printed and returned.
xfun
optional function to be applied to the x variable prior to
plotting. Defaults to NULL, which translates to ifun(x$call.sitar$x)
and inverts any transformation applied to x in the original SITAR model
call. To plot on the transformed scale set xfun
to I
.
yfun
optional function to be applied to the y variable prior to
plotting. Defaults to NULL, which translates to ifun(x$call.sitar$y)
and inverts any transformation applied to y in the original SITAR model
call. To plot on the transformed scale set yfun
to I
.
subset
optional logical vector of length x
defining a subset
of data
rows to be plotted.
ns
scalar defining the number of points for spline curves
(default 101).
abc
vector of named values of random effects a, b and c used to
define an individual growth curve, e.g. abc=c(a=1, c=-0.1). Alternatively a
single character string defining an id
level whose random effect
values are used. If abc
is set, level
is ignored. If
abc
is NULL (default), or if a, b or c values are missing, values of
zero are assumed.
add
optional logical defining if the plot is pre-existing (TRUE) or
new (FALSE). TRUE is equivalent to using lines
.
nlme
optional logical which set TRUE plots the model as an
nlme
object, using plot.nlme
arguments.
...
Further graphical parameters (see par
) may also be
supplied as arguments, e.g. axis labels xlab
and ylab
, line
type lty
, line width lwd
, and color col
. For the
velocity (y2) plot y2par
can be used (see Details).