Learn R Programming

⚠️There's a newer version (0.3.14) of this package.Take me there.

mmrm (version 0.3.12)

Mixed Models for Repeated Measures

Description

Mixed models for repeated measures (MMRM) are a popular choice for analyzing longitudinal continuous outcomes in randomized clinical trials and beyond; see Cnaan, Laird and Slasor (1997) for a tutorial and Mallinckrodt, Lane, Schnell, Peng and Mancuso (2008) for a review. This package implements MMRM based on the marginal linear model without random effects using Template Model Builder ('TMB') which enables fast and robust model fitting. Users can specify a variety of covariance matrices, weight observations, fit models with restricted or standard maximum likelihood inference, perform hypothesis testing with Satterthwaite or Kenward-Roger adjustment, and extract least square means estimates by using 'emmeans'.

Copy Link

Version

Install

install.packages('mmrm')

Monthly Downloads

3,712

Version

0.3.12

License

Apache License 2.0

Maintainer

Daniel Sabanes Bove

Last Published

June 26th, 2024

Functions in mmrm (0.3.12)

emit_tidymodels_register_msg

Format a Message to Emit When Tidymodels is Loaded
h_df_md_from_1d

Creating F-Statistic Results from One-Dimensional Contrast
h_construct_model_frame_inputs

Construction of Model Frame Formula and Data Inputs
h_default_value

Default Value on NULL Return default value when first argument is NULL.
h_extract_covariance_terms

Extract Formula Terms used for Covariance Structure Definition
h_drop_covariance_terms

Drop Formula Terms used for Covariance Structure Definition
h_df_md_kr

Calculation of Kenward-Roger Degrees of Freedom for Multi-Dimensional Contrast
fit_mmrm

Low-Level Fitting Function for MMRM
fit_single_optimizer

Fitting an MMRM with Single Optimizer
h_df_min_bw

Assign Minimum Degrees of Freedom Given Involved Coefficients
covariance_types

Covariance Types
df_1d

Calculation of Degrees of Freedom for One-Dimensional Contrast
h_df_1d_res

Calculation of Residual Degrees of Freedom for One-Dimensional Contrast
h_df_md_bw

Calculation of Between-Within Degrees of Freedom for Multi-Dimensional Contrast
h_df_to_tibble

Coerce a Data Frame to a tibble
h_confirm_large_levels

Ask for Confirmation on Large Visit Levels
h_df_1d_sat

Calculation of Satterthwaite Degrees of Freedom for One-Dimensional Contrast
h_get_empirical

Obtain Empirical/Jackknife/Bias-Reduced Covariance
h_jac_list

Obtain List of Jacobian Matrix Entries for Covariance Matrix
h_factor_ref_data

Convert Character to Factor Following Reference MMRM Fit.
h_get_optimizers

Obtain Optimizer according to Optimizer String Value
format_symbols

Format Symbol Objects
cov_type_name

Retrieve Associated Full Covariance Structure Type Name
h_factor_ref

Convert Character to Factor Following Reference
h_df_bw_calc

Calculation of Between-Within Degrees of Freedom
h_partial_fun_args

Create Partial Functions
h_get_contrast

Obtain Contrast for Specified Effect
h_print_aic_list

Printing AIC and other Model Fit Criteria
h_kr_df

Obtain the Adjusted Kenward-Roger degrees of freedom
h_get_kr_comp

Obtain Kenward-Roger Adjustment Components
format.cov_struct

Format Covariance Structure Object
df_md

Calculation of Degrees of Freedom for Multi-Dimensional Contrast
h_get_cov_default

Obtain Default Covariance Method
formula_rhs

Extract Right-Hand-Side (rhs) from Formula
h_tr

Trace of a Matrix
flat_expr

Flatten Expressions for Non-standard Evaluation
h_md_denom_df

Calculating Denominator Degrees of Freedom for the Multi-Dimensional Case
h_df_1d_bw

Calculation of Between-Within Degrees of Freedom for One-Dimensional Contrast
h_valid_formula

Validate mmrm Formula
h_mmrm_tmb_check_conv

Checking the TMB Optimization Result
h_df_1d_kr

Calculation of Kenward-Roger Degrees of Freedom for One-Dimensional Contrast
h_df_md_res

Calculation of Residual Degrees of Freedom for Multi-Dimensional Contrast
h_mmrm_tmb_data

Data for TMB Fit
h_df_md_sat

Calculation of Satterthwaite Degrees of Freedom for Multi-Dimensional Contrast
mmrm_control

Control Parameters for Fitting an MMRM
h_quad_form

Quadratic Form Calculations
h_get_prediction

Get Prediction
h_print_call

Printing MMRM Function Call
h_newdata_add_pred

Add Prediction Results to New Data
h_summarize_all_fits

Summarizing List of Fits
mmrm_methods

Methods for mmrm Objects
h_mmrm_tmb_assert_start

Asserting Sane Start Values for TMB Fit
h_print_cov

Printing MMRM Covariance Type
h_optimizer_fun

Obtain Optimizer Function with Character
h_record_all_output

Capture all Output
print.cov_struct

Print a Covariance Structure Object
h_reconcile_cov_struct

Reconcile Possible Covariance Structure Inputs
h_register_s3

Register S3 Method Register S3 method to a generic.
h_get_prediction_variance

Get Prediction Variance
h_test_1d

Creating T-Statistic Test Results For One-Dimensional Contrast
h_get_sim_per_subj

Get simulated values by patient.
h_mmrm_tmb_extract_cov

Extract covariance matrix from TMB report and input data
mmrm-package

mmrm Package
mmrm

Fit an MMRM
h_mmrm_tmb_fit

Build TMB Fit Result List
mmrm_tidiers

Tidying Methods for mmrm Objects
refit_multiple_optimizers

Refitting MMRM with Multiple Optimizers
h_get_theta_from_cov

Obtain Theta from Covariance Matrix
h_residuals_normalized

Calculate normalized residuals
h_tbl_confint_terms

Extract tibble with Confidence Intervals and Term Names
parsnip_add_mmrm

Register mmrm For Use With tidymodels
h_warn_na_action

Warn on na.action
h_mmrm_tmb_formula_parts

Processing the Formula for TMB Fit
h_var_adj

Obtain the Adjusted Covariance Matrix
mmrm_tmb_methods

Methods for mmrm_tmb Objects
h_gradient

Computation of a Gradient Given Jacobian and Contrast Vector
h_residuals_pearson

Calculate Pearson Residuals
h_split_control

Split Control List
h_within_or_between

Determine Within or Between for each Design Matrix Column
h_test_md

Creating F-Statistic Test Results For Multi-Dimensional Contrast
h_residuals_response

Calculate response residuals.
validate_cov_struct

Validate Covariance Structure Data
reexports

Objects exported from other packages
is_infix

Test Whether a Symbol is an Infix Operator
h_mmrm_tmb_parameters

Start Parameters for TMB Fit
std_start

Standard Starting Value
position_symbol

Search For the Position of a Symbol
register_on_load

Helper Function for Registering Functionality With Suggests Packages
tmb_cov_type

Produce A Covariance Identifier Passing to TMB
check_package_version

Check Suggested Dependency Against Version Requirements
component

Component Access for mmrm_tmb Objects
as.cov_struct

Coerce into a Covariance Structure Definition
cov_struct

Define a Covariance Structure
COV_TYPES

Covariance Type Database
drop_elements

Drop Items from an Indexible
cov_type_abbr

Retrieve Associated Abbreviated Covariance Structure Type Name
bcva_data

Example Data on BCVA
cached_mmrm_results

Cache Data for mmrm Model Comparison
Anova.mmrm

Conduct type II/III hypothesis testing on the MMRM fit results.
car_add_mmrm

Register mmrm For Use With car::Anova
fev_data

Example Data on FEV1
fill_names

Complete character Vector Names From Values
emp_start

Empirical Starting Value
emmeans_support

Support for emmeans
h_add_covariance_terms

Add Individual Covariance Variables As Terms to Formula
h_coef_table

Coefficients Table for MMRM Fit
h_add_terms

Add Formula Terms with Character