Learn R Programming

sitar (version 1.0.2)

predict.sitar: Predict SITAR model

Description

Predict method for sitar objects, based on predict.lme.

Usage

## S3 method for class 'sitar':
predict(object, newdata, level=1, ...)

Arguments

object
an object inheriting from class sitar.
newdata
an optional data frame to be used for obtaining the predictions. It requires named columns for x, and for id if level = 1. Any covariates in a.formula, b.formula or c.formula ca
level
an optional integer vector giving the level of grouping to be used in obtaining the predictions, level zero corresponding to the population predictions. Defaults to level 1.
...
other optional arguments, including asList, na.action and naPattern.

Value

  • A vector of the predictions, or a list of vectors if asList = TRUE or length(level) > 1.

Examples

Run this code
data(heights)
## fit model
m1 <- sitar(x=age, y=height, id=id, data=heights, df=5)

## predictions at level 0
predict(m1, newdata=data.frame(x=9:16), level=0)

## predictions at level 1 for subject 5
predict(m1, newdata=data.frame(x=9:16, id=5), level=1)

Run the code above in your browser using DataLab