sm.rm | R Documentation |
This function estimates nonparametrically the mean profile from a matrix
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 |
matrix containing the values of the response variable, with rows associated to individuals and columns associated to observation times. |
Time |
a vector containing the observation times of the response variable, assumed
to be the same for all individuals of matrix |
minh |
the minimum value of the interval where the optimal value of the smoothing parameter is searched according to the modified Rice criterion. See reference below for details. |
maxh |
the maximum value of the above interval. |
optimize |
Logical value, default is |
rice.display |
If this set to |
... |
other optional parameters are passed to the
|
see Section 7.4 of the reference below.
a list containing the returned value produced by 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.
if the parameter display is not set to "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.
Bowman, A.W. and Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: the Kernel Approach with S-Plus Illustrations. Oxford University Press, Oxford.
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)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.