Search code examples
rinterpolationlmextrapolation

Extra/Inter-polate from a Model


I managed to get some regression done using

lm(d$result~d$param1+d$param2) -> model

Now I would like to use model to extrapolate (or interpolate) the result for a new dataframe. How can I do it ? I'm sure there is already a function for that.


Solution

  • Lookup ?predict.lm.

    If dat is a data frame with new data, predict(model, newdata = dat)