y
which is assumed to contain repeated measurements (i.e. longitudinal
data) from a set of individuals.
sm.rm(Time, y, minh = 0.1, maxh = 2, optimize = FALSE, rice.display = FALSE, ...)
y
.
If Time
is not given, this is assumed to be 1:ncol(y)
.
optimize=FALSE
. If
optimize=TRUE
, then a full
optimization is performed after searching the interval (minh,maxh)
using the optimizer optim
.
TRUE
(default is FALSE
), a plot is
produced of the curve
representing the modified Rice criterion for bandwidth selection.
See reference below for details.
sm.options
function, through a mechanism which limits their effect only to this
call of the function; those relevant for this function are the following:
add=FALSE
. If add=TRUE
and
display is not set to "none"
, then graphical output added
to the existing plot, rather than starting a new one.
sm.regression
.
Default value is display="lines"
.
ngrid=20
.
sm.regression
. Default: ngrid=1
.
sm.regression
when
smoothing the mean response value at each given observation time,
with an extra component $aux
added to the list.
This additional component is a list itself containing the mean value at each
observation time, the residual variance of the residuals from the estimated
regression curve, the autocorrelation function of the residuals, and
the value h
of the chosen smoothing parameter.
"none"
, a plot of the estimated
regression curve is produced;
other aspects are controlled by the optional parameters (...
).
If rice.display=TRUE
, a plot of the modified Rice criterion is shown.sm.regression
, sm.regression.autocor
, optim
sm.rm(y=as.matrix(citrate), display.rice=TRUE)
#
with(dogs, {
Time <- seq(1,13,by=2)
gr1 <- as.matrix(dogs[dogs$Group==1,2:8])
plot(c(1,13), c(3,6),xlab="time", ylab="potassium", type="n")
sm1 <- sm.rm(Time, gr1, display="se", add=TRUE)
})
Run the code above in your browser using DataLab