Learn R Programming

mmrm (version 0.3.14)

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,921

Version

0.3.14

License

Apache License 2.0

Maintainer

Daniel Sabanes Bove

Last Published

September 27th, 2024

Functions in mmrm (0.3.14)

drop_elements

Drop Items from an Indexible
h_add_covariance_terms

Add Individual Covariance Variables As Terms to Formula
emit_tidymodels_register_msg

Format a Message to Emit When Tidymodels is Loaded
h_df_1d_sat

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

Creating F-Statistic Results from One-Dimensional Contrast
h_add_terms

Add Formula Terms with Character
h_newdata_add_pred

Add Prediction Results to New Data
h_gradient

Computation of a Gradient Given Jacobian and Contrast Vector
h_get_empirical

Obtain Empirical/Jackknife/Bias-Reduced Covariance
h_df_md_kr

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

Coerce a Data Frame to a tibble
h_get_cov_default

Obtain Default Covariance Method
h_df_min_bw

Assign Minimum Degrees of Freedom Given Involved Coefficients
h_df_1d_res

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

Start Parameters for TMB Fit
h_drop_covariance_terms

Drop Formula Terms used for Covariance Structure Definition
h_jac_list

Obtain List of Jacobian Matrix Entries for Covariance Matrix
fit_mmrm

Low-Level Fitting Function for MMRM
is_infix

Test Whether a Symbol is an Infix Operator
fit_single_optimizer

Fitting an MMRM with Single Optimizer
format_symbols

Format Symbol Objects
mmrm-package

mmrm Package
h_get_na_action

Obtain na.action as Function
emmeans_support

Support for emmeans
emp_start

Empirical Starting Value
h_drop_levels

Drop Levels from Dataset
h_mmrm_tmb_fit

Build TMB Fit Result List
h_quad_form

Quadratic Form Calculations
h_mmrm_tmb_assert_start

Asserting Sane Start Values for TMB Fit
h_mmrm_tmb_formula_parts

Processing the Formula for TMB Fit
h_df_1d_bw

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

Calculate response residuals.
h_df_1d_kr

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

Reconcile Possible Covariance Structure Inputs
h_split_control

Split Control List
h_get_optimizers

Obtain Optimizer according to Optimizer String Value
reexports

Objects exported from other packages
refit_multiple_optimizers

Refitting MMRM with Multiple Optimizers
h_coef_table

Coefficients Table for MMRM Fit
mmrm

Fit an MMRM
fill_names

Complete character Vector Names From Values
h_confirm_large_levels

Ask for Confirmation on Large Visit Levels
h_construct_model_frame_inputs

Construction of Model Frame Formula and Data Inputs
h_mmrm_tmb_check_conv

Checking the TMB Optimization Result
h_print_call

Printing MMRM Function Call
print.cov_struct

Print a Covariance Structure Object
h_tmb_warn_non_deterministic

Warn if TMB is Configured to Use Non-Deterministic Hash for Tape Optimizer
position_symbol

Search For the Position of a Symbol
h_df_bw_calc

Calculation of Between-Within Degrees of Freedom
h_residuals_pearson

Calculate Pearson Residuals
h_print_cov

Printing MMRM Covariance Type
h_tr

Trace of a Matrix
h_residuals_normalized

Calculate normalized residuals
formula_rhs

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

Check if the Effect is the First Categorical Effect
h_df_md_bw

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

Control Parameters for Fitting an MMRM
std_start

Standard Starting Value
register_on_load

Helper Function for Registering Functionality With Suggests Packages
h_default_value

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

Check if a Factor Should Drop Levels
h_get_contrast

Obtain Contrast for Specified Effect
h_extract_covariance_terms

Extract Formula Terms used for Covariance Structure Definition
h_md_denom_df

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

Obtain the Adjusted Kenward-Roger degrees of freedom
h_get_index

Test if the First Vector is Subset of the Second Vector
h_get_kr_comp

Obtain Kenward-Roger Adjustment Components
h_get_sim_per_subj

Get simulated values by patient.
h_optimizer_fun

Obtain Optimizer Function with Character
h_obtain_lvls

Obtain Levels Prior and Posterior
h_get_theta_from_cov

Obtain Theta from Covariance Matrix
flat_expr

Flatten Expressions for Non-standard Evaluation
h_test_1d

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

Creating F-Statistic Test Results For Multi-Dimensional Contrast
format.cov_struct

Format Covariance Structure Object
h_df_md_res

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

Summarizing List of Fits
h_print_aic_list

Printing AIC and other Model Fit Criteria
h_partial_fun_args

Create Partial Functions
h_tbl_confint_terms

Extract tibble with Confidence Intervals and Term Names
h_warn_na_action

Warn on na.action
h_within_or_between

Determine Within or Between for each Design Matrix Column
h_valid_formula

Validate mmrm Formula
mmrm_methods

Methods for mmrm Objects
h_var_adj

Obtain the Adjusted Covariance Matrix
mmrm_tidiers

Tidying Methods for mmrm Objects
mmrm_tmb_methods

Methods for mmrm_tmb Objects
parsnip_add_mmrm

Register mmrm For Use With tidymodels
h_df_md_sat

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

Produce A Covariance Identifier Passing to TMB
h_get_prediction

Get Prediction
h_get_prediction_variance

Get Prediction Variance
h_mmrm_tmb_data

Data for TMB Fit
h_mmrm_tmb_extract_cov

Extract covariance matrix from TMB report and input data
h_record_all_output

Capture all Output
h_register_s3

Register S3 Method Register S3 method to a generic.
validate_cov_struct

Validate Covariance Structure Data
component

Component Access for mmrm_tmb Objects
cached_mmrm_results

Cache Data for mmrm Model Comparison
as.cov_struct

Coerce into a Covariance Structure Definition
car_add_mmrm

Register mmrm For Use With car::Anova
cov_struct

Define a Covariance Structure
check_package_version

Check Suggested Dependency Against Version Requirements
bcva_data

Example Data on BCVA
Anova.mmrm

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

Retrieve Associated Full Covariance Structure Type Name
cov_type_abbr

Retrieve Associated Abbreviated Covariance Structure Type Name
covariance_types

Covariance Types
COV_TYPES

Covariance Type Database
fev_data

Example Data on FEV1
df_1d

Calculation of Degrees of Freedom for One-Dimensional Contrast
df_md

Calculation of Degrees of Freedom for Multi-Dimensional Contrast