Hi there, I'm attempting to use one model to calibrate another one. I need to use the data from the Vercoe site to validate the data on the Terapa site.

slm <- lm(observed ~ x, data = vercoe)

summary(slm)$coef

Estimate Std. Error t value Pr(>|t|)

(Intercept) 0.380600750.444198479 0.8568259 4.003808e-01

x 0.023058570.003339521 6.9047544 4.864890e-07

slm2 <- lm(observed ~ x, data = terapa)

summary(slm2)$coef

Estimate Std. Error t value Pr(>|t|)

(Intercept) 2.0329589 0.365102194 5.568191 6.936300e-07

x 0.0125283 0.001024675 12.226606 1.079644e-17

I tried using this:

terapa$predicted <- predict(slm, newdata = terapa)

Which adds a column with the right predictions alright, but what I need is to fundamentally change the fitted values of slm2. I've also tried manually setting the coef, but the fitted values remain unchanged after that.

The other problem I face is that Vercoe site only has 25 observations and Terapa site 60. How can I apply the coefficients from slm to slm2 to find the fitted values?

My way only gets me to the predicted values but the residuals are obviously not what I'm looking for.

Hope someone can help.

Thanks!