fitted.joint: Obtain joint model fitted values

View source: R/fitted.R

fitted.jointR Documentation

Obtain joint model fitted values

Description

returns the fitted values from a joint object. Note that the linear predictor for each k=1,\dots,K response is returned.

Usage

## S3 method for class 'joint'
fitted(object, as = "matrix", ...)

Arguments

object

a joint model fit by the joint function.

as

should the fitted values be returned as a "matrix" (the default) or as a "list"? Note that as="matrix" only works for balanced responses.

...

Additional arguments (none used).

Value

A matrix (or list) with a column (or list entry) for each of the fitted linear predictors with class fitted.joint.

Author(s)

James Murray (j.murray7@ncl.ac.uk).

See Also

residuals.joint

Examples


# Bivariate fit on PBC data -----------------------------------------
data(PBC)

# Subset data and remove NAs
PBC <- subset(PBC, select = c('id', 'survtime', 'status', 'drug', 'time',
                              'albumin', 'platelets'))
PBC <- na.omit(PBC) 

# Specify bivariate fit
long.formulas <- list(
  albumin ~ time*drug + (1 + time|id),
  platelets ~ time * drug + (1 + time|id)
)
surv.formula <- Surv(survtime, status) ~ drug

fit <- joint(long.formulas, surv.formula, PBC, family = list('gaussian', 'poisson'))
fitted(fit)


gmvjoint documentation built on Oct. 6, 2024, 1:07 a.m.