interplinear {lgtdl} | R Documentation |
A linear interpolation, using approx
, is used to obtain
estimates of the covariate at times other than those observed.
interplinear(x, ...) interplinear.lgtdl(x, time, cov = NULL, ...) interplinear.AsIs(x, ...)
x |
The lgtdl object that is to be interpolated. |
time |
|
cov |
The name of the covariate in the lgtdl object on
which the interpolation should be based. It is not required if there
is only one covariate. |
... |
Ignored. |
A vector containing the interpolated estimates of the covariate values at the requested times.
Robert Gentleman
x1<-data.frame(time=c(1,3,5), cov=c(4,6,8)) x2<-data.frame(time=c(11,13,15), interest=c(66,45,88)) x1<-as.lgtdl(x1) x2<-as.lgtdl(x2) interpprev(x1, 4) interpprev(x2, c(12, 14))