Compute the fitted values of a fitted progression model for repeated measures.
Usage
# S3 method for class 'pmrm_fit'
fitted(object, adjust = TRUE, ...)Arguments
- object
A fitted model object of class
"pmrm_fit".- adjust
TRUEorFALSE.adjust = TRUEreturns estimates and inference for covariate-adjustedmu_ijvalues (defined invignette("models", package = "pmrm")) for new data.adjust = FALSEinstead returns inference onmu_ij - W %*% gamma, the non-covariate-adjusted predictions useful in plotting a continuous disease progression trajectory inplot.pmrm_fit().- ...
Not used.
Details
For pmrm, fitted() is much faster than predict()
for large datasets, but the output only includes the estimates
(no measures of uncertainty).
See also
Other predictions:
predict.pmrm_fit(),
residuals.pmrm_fit()
Examples
set.seed(0L)
simulation <- pmrm_simulate_decline_proportional(
visit_times = seq_len(5L) - 1,
gamma = c(1, 2)
)
fit <- pmrm_model_decline_proportional(
data = simulation,
outcome = "y",
time = "t",
patient = "patient",
visit = "visit",
arm = "arm",
covariates = ~ w_1 + w_2
)
str(fitted(fit))
#> num [1:1500] -1.026 1.574 -2.106 0.727 -0.773 ...
