fitted | R Documentation |
Extract fitted values for joint models.
## S3 method for class 'jmcs'
fitted(
object,
type = c("Marginal", "Subject"),
process = c("Longitudinal", "Event"),
...
)
object |
an object inheriting from class |
type |
for which type of fitted values to calculate. |
process |
for which sub-model to calculate the fitted values. |
... |
further arguments passed to or from other methods. |
a numeric vector of fitted values.
Shanpeng Li lishanpeng0913@ucla.edu
fit <- jmcs(ydata = ydata, cdata = cdata,
long.formula = response ~ time + gender + x1 + race,
surv.formula = Surv(surv, failure_type) ~ x1 + gender + x2 + race,
random = ~ time| ID)
# fitted for the longitudinal process
head(cbind(
"Marg" = fitted(fit, type = "Marginal", process = "Longitudinal"),
"Subj" = fitted(fit, type = "Subject", process = "Longitudinal")
))
# fitted for the levent process - marginal survival function
head(fitted(fit, type = "Marginal", process = "Event"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.