predict.lqmm: Predictions from an 'lqmm' Object

View source: R/lqmm.R

predict.lqmmR Documentation

Predictions from an lqmm Object

Description

The predictions at level 0 correspond to predictions based only on the fixed effects estimates. The predictions at level 1 are obtained by adding the best linear predictions of the random effects to the predictions at level 0. See details for interpretation. The function predint will produce 1-alpha confidence intervals based on bootstrap centiles.

Usage

## S3 method for class 'lqmm'
predict(object, newdata, level = 0,
	na.action = na.pass, ...)
## S3 method for class 'lqmm'
predint(object, level = 0, alpha = 0.05,
	R = 50, seed = round(runif(1, 1, 10000)))

Arguments

object

an lqmm object.

newdata

an optional data frame in which to look for variables with which to predict. If omitted, the fitted values are produced.

level

an optional integer vector giving the level of grouping to be used in obtaining the predictions.

na.action

function determining what should be done with missing values in newdata. The default is to predict NA.

alpha

1-alpha is the confidence level.

R

number of bootstrap replications.

seed

optional random number generator seed.

...

not used.

Details

As discussed by Geraci and Bottai (2014), integrating over the random effects will give "weighted averages" of the cluster-specific quantile effects. These may be interpreted strictly as population regression quantiles for the median (tau=0.5) only. Therefore, predictions at the population level (code=0) should be interpreted analogously.

Value

a vector or a matrix of predictions for predict.lqmm. A data frame or a list of data frames for predint.lqmm containing predictions, lower and upper bounds of prediction intervals, and standard errors.

Author(s)

Marco Geraci

References

Geraci M and Bottai M (2014). Linear quantile mixed models. Statistics and Computing, 24(3), 461–479.

See Also

lqmm, ranef.lqmm, coef.lqmm

Examples

## Orthodont data
data(Orthodont)

# Random intercept model
fitOi.lqmm <- lqmm(distance ~ age, random = ~ 1, group = Subject,
	tau = c(0.1,0.5,0.9), data = Orthodont)

# Predict (y - Xb)	
predict(fitOi.lqmm, level = 0)

# Predict (y - Xb - Zu)
predict(fitOi.lqmm, level = 1)

# 95% confidence intervals
predint(fitOi.lqmm, level = 0, alpha = 0.05)


lqmm documentation built on April 6, 2022, 5:09 p.m.