predict.qlss.Rd
This function computes predictions based on fitted conditional QLSS objects.
# S3 method for class 'qlss'
predict(object, newdata, interval = FALSE, level = 0.95, R = 200,
na.action = na.pass, trim = 0.05, ...)
an object as returned by qlss.formula
.
an optional data frame in which to look for variables with which to predict. If omitted, the fitted values are used.
logical flag. If TRUE
, confidence intervals for predictions are computed by bootstrap.
nominal coverage level of the confidence interval.
number of bootstrap replications used to compute confidence intervals.
function determining what should be done with missing values in newdata
. The default is to predict NA
.
proportion of extreme bootstrap replications to be trimmed before standard errors are computed.
not used.
if (FALSE) { # \dontrun{
# Fit QLSS object
trees2 <- trees[order(trees$Height),]
fit <- qlss(Volume ~ Height, data = trees2)
## Predict using newdata. Calculate confidence intervals using 200 bootstrap replications
# large confidence intervals for shape index due to small IQR at low values of height
#xx <- seq(min(trees2$Height), max(trees2$Height), length = 100)
#new <- data.frame(Height = xx)
#set.seed(121)
#fit.pred <- predict(fit, newdata = new, interval = TRUE, level = 0.95, R = 200)
#plot(fit.pred, z = xx, interval = TRUE, xlab = "height")
# Restrict range for Height
xx <- seq(65, 87, length = 100)
new <- data.frame(Height = xx)
set.seed(121)
fit.pred <- predict(fit, newdata = new, interval = TRUE, level = 0.95, R = 200)
plot(fit.pred, z = xx, interval = TRUE, xlab = "height") # better
} # }