source("http://192.38.117.59/~linearpredictors/datafiles/readBirthWeight.R") ## model with product term model <- lm(log10(bw) ~ log10(ad) + log10(bpd) + I(log10(ad)*log10(bpd)), data = secher) ## function to calculate the predicted line for any value of ad. f <- function(ad){ list( ad = ad, log10ad = log10(ad), Intercept = model$coef["(Intercept)"] + log10(ad)*model$coef["log10(ad)"], Slope = model$coef["log10(bpd)"] + model$coef["I(log10(ad) * log10(bpd))"]*log10(ad) ) } sapply(c(90,100,110), f)