## Estimate logarithmic model
fert.est <- ols(barley ~ phos + nit, data = log(data.fertilizer))
## Set new x data
my.mat = cbind(x1 = log(c(6,3,9)), x2 = log(c(5,3,10)))
## Returns fitted values
ols.predict(fert.est)
## Returns predicted values at new x-values
ols.predict(fert.est, xnew = my.mat)
## Returns re-transformed predicted values and est. var. of pred. error
ols.predict(fert.est, xnew = my.mat, antilog = TRUE, details = TRUE)
Run the code above in your browser using DataLab