g_mmrm_diagnostic(
object,
type = c("fit-residual", "q-q-residual"),
z_threshold = NULL
)(tern_mmrm)
model result produced by fit_mmrm().
(string)
specifying the type of diagnostic plot to be produced:
fit-residual: A fitted vs residuals plot, grouped by visits.
This allows to see if there is remaining
structure in the residuals that might be captured by adding additional
covariates to the model.
q-q-residual: A Q-Q plot for the residuals (i.e. sorted standardized residuals
vs. normal quantiles), grouped by visits. Observations with an absolute
standardized residual above z_threshold will be labeled.
(numeric)
optional number indicating the normal quantile threshold
for the Q-Q plot.
A ggplot2 plot.
Here we use marginal fitted values and residuals. That is, we estimate fitted values, and the difference of those fitted values vs. the observed data are the residuals.
g_mmrm_lsmeans() for plotting the least-squares means and contrasts.
mmrm_results <- fit_mmrm(
vars = list(
response = "FEV1",
covariates = c("RACE", "SEX"),
id = "USUBJID",
arm = "ARMCD",
visit = "AVISIT"
),
data = mmrm_test_data,
cor_struct = "unstructured",
weights_emmeans = "equal"
)
#> Error in refit_multiple_optimizers(fit = fit, control = control): No optimizer led to a successful model fit. Please try to use a different covariance structure or other covariates.
g_mmrm_diagnostic(mmrm_results)
#> Error: object 'mmrm_results' not found
g_mmrm_diagnostic(mmrm_results, type = "q-q-residual")
#> Error: object 'mmrm_results' not found