fert.est <- ols(barley ~ phos + nit, data = log(data.fertilizer))
my.mat = cbind(x1 = log(c(6,3,9)), x2 = log(c(5,3,10)))
## 95% CI for all parameters
ols.interval(fert.est)
## 95% CI for intercept and beta2
ols.interval(fert.est, which.coef = c(1,3))
## 95% CI around three true, constant y-values
ols.interval(fert.est, xnew = my.mat)
## AI for H0:beta1 = 0.5 and H0:beta2 = 0.5
ols.interval(fert.est, type = "acc", which.coef = c(2,3), q = 0.5)
## AI for H0:beta1 <= 0.5
ols.interval(fert.est, type = "acc", which.coef = 2, dir = "right", q = 0.5)
## PI (Textbook p. 285)
ols.interval(fert.est, type = "pred", xnew = c(x1 = log(29), x2 = log(120)), details = TRUE)
## Three PI
ols.interval(fert.est, type = "pred", xnew = my.mat, details = TRUE)
Run the code above in your browser using DataLab