library(mmrm)
Similar to model objects created in other packages, components of mmrm and
mmrm_tmb objects can be accessed with standard methods. Additionally,
component() is provided to allow deeper and more precise access for those
interested in digging through model output.
Complete documentation of standard model output methods supported for mmrm_tmb
objects can be found at the package website.
The summary method for mmrm objects provides easy access to frequently needed
model components.
fit <- mmrm( formula = FEV1 ~ RACE + ARMCD * AVISIT + us(AVISIT | USUBJID), data = fev_data ) fit_summary <- summary(fit)
From this summary object, you can easily retrieve the coefficients table.
fit_summary$coefficients
Other model parameters and metadata available in the summary object is as follows:
str(fit_summary)
The residuals method for mmrm objects can be used to provide three different types of residuals:
fit <- mmrm( formula = FEV1 ~ RACE + ARMCD * AVISIT + us(AVISIT | USUBJID), data = fev_data ) residuals_resp <- residuals(fit, type = "response")
residuals_pearson <- residuals(fit, type = "pearson")
residuals_norm <- residuals(fit, type = "normalized")
broom extensionsmmrm also contains S3 methods methods for tidy, glance and augment which were
introduced by broom. Note that these methods
will work also without loading the broom package.
Please see ?mmrm_tidiers for the detailed documentation.
For example, we can apply the tidy method to return a summary table of coefficient estimates:
fit |> tidy()
We can also specify some details to request confidence intervals of specific confidence level:
fit |> tidy(conf.int = TRUE, conf.level = 0.9)
Or we can apply the glance method to return a summary table of goodness of fit statistics:
fit |> glance()
Finally, we can use the augment method to return a merged tibble of the data, fitted values and residuals:
fit |> augment()
Also here we can specify details for the prediction intervals and type of residuals via the arguments:
fit |> augment(interval = "confidence", type.residuals = "normalized")
Specific model quantities not supported by methods can be retrieved with the
component()
function. The default will output all supported components.
For example, a user may want information about convergence:
component(fit, name = c("convergence", "evaluations", "conv_message"))
or the original low-level call:
component(fit, name = "call")
the user could also ask for all provided components by not specifying the name
argument.
component(fit)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.