Description Usage Arguments Details Value Author(s) References Examples
Calculates fitted values for joint models.
1 2 3 4 5 6 7 8 9 10 11 | ## S3 method for class 'JMbayes'
fitted(object,
process = c("Longitudinal", "longitudinal", "Event", "event"),
type = c("Marginal", "marginal", "Subject", "subject"), nullY = FALSE, ...)
## S3 method for class 'JMbayes'
residuals(object,
process = c("Longitudinal", "longitudinal", "Event", "event"),
type = c("Marginal", "marginal", "Subject", "subject",
"Martingale", "martingale", "nullMartingale", "nullmartingale"),
standardized = FALSE, ...)
|
object |
an object inheriting from class |
process |
for which model (i.e., linear mixed model or survival model) to calculate fitted values or residuals. |
type |
what type of fitted values or residuals to calculate. See Details. |
nullY |
logical; if |
standardized |
logical; if |
... |
additional arguments; currently none is used. |
For process = "Longitudinal"
, let X denote the design matrix for the fixed effects β, and
Z the design matrix for the random effects b. Then for type = "Marginal"
the fitted values are
X \hat{β}, whereas for type = "Subject"
they are X \hat{β} + Z \hat{b}, where \hat{β}
and \hat{b} denote the corresponding posterior means for the fixed and random effects. The corresponding residuals
are calculated by subtracting the fitted values from the observed data y. If type = "Subject"
and
standardized = TRUE
, the residuals are divided by the estimated residual standard error.
For process = "Event"
function fitted()
calculates the cumulative hazard function at each time point a longitudinal
measurement has been recorded. If nullY = TRUE
, then the cumulative hazard is calculated without the contribution of the
longitudinal process. Function residuals()
calculates the martingales residuals or the martingale residuals without the
contribution of the longitudinal process when type = "nullMartingale"
.
a numeric vector of fitted values or residuals.
Dimitris Rizopoulos d.rizopoulos@erasmusmc.nl
Rizopoulos, D. (2012) Joint Models for Longitudinal and Time-to-Event Data: with Applications in R. Boca Raton: Chapman and Hall/CRC.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
lmeFit <- lme(log(serBilir) ~ ns(year, 2), data = pbc2,
random = ~ ns(year, 2) | id)
survFit <- coxph(Surv(years, status2) ~ 1, data = pbc2.id, x = TRUE)
jointFit <- jointModelBayes(lmeFit, survFit, timeVar = "year")
fitted(jointFit, process = "Event")
residuals(jointFit, type = "Subject", standardized = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.