[R] interpolation

Douglas Bates bates at stat.wisc.edu
Mon Nov 4 17:38:04 CET 2002


"Marwan Khawaja" <mk36 at aub.edu.lb> writes:

> I have 15 data points (weight at birth) by age which I want to
> interpolate back in time (to 5 more age points).

I'm not sure if I understand what you are asking.  The phrase "back in
time" seems to indicate extrapolation rather than interpolation.

> There are many functions in R to do this and I wonder if anyone has
> experience in using these -- any preference/caveat etc? I am trying
> to find an alternative to linear interpolation.

You could try interpSpline in the splines package.  That produces a
"natural spline" that can be used for interpolation within the range
of the data or extrapolation beyond the range of the data.  Linear
extrapolation, based on the derivative of the fitted function at the
end points, is used.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list