Package: MRTAnalysis 0.4.1

MRTAnalysis: Assessing Proximal, Distal, and Mediated Causal Excursion Effects for Micro-Randomized Trials

Provides methods to analyze micro-randomized trials (MRTs) with binary treatment options. Supports four types of analyses: (1) proximal causal excursion effects, including weighted and centered least squares (WCLS) for continuous proximal outcomes by Boruvka et al. (2018) <doi:10.1080/01621459.2017.1305274> and the estimator for marginal excursion effect (EMEE) for binary proximal outcomes by Qian et al. (2021) <doi:10.1093/biomet/asaa070>; (2) distal causal excursion effects (DCEE) for continuous distal outcomes using a two-stage estimator by Qian (2025) <doi:10.1093/biomtc/ujaf134>; (3) mediated causal excursion effects (MCEE) for continuous distal outcomes, estimating natural direct and indirect excursion effects in the presence of time-varying mediators by Qian (2025) <doi:10.48550/arXiv.2506.20027>; and (4) standardized proximal effect size estimation for continuous proximal outcomes, generalizing the approach in Luers et al. (2019) <doi:10.1007/s11121-017-0862-5> to allow adjustment for baseline and time-varying covariates for improved efficiency.

Authors:Tianchen Qian [aut, cre], Shaolin Xiang [aut], Zhaoxi Cheng [aut], Xinyi Song [aut], John Dziak [aut], Audrey Boruvka [ctb]

MRTAnalysis_0.4.1.tar.gz
MRTAnalysis_0.4.1.zip(r-4.7-any)MRTAnalysis_0.4.1.zip(r-4.6-any)MRTAnalysis_0.4.1.zip(r-4.5-any)
MRTAnalysis_0.4.1.tgz(r-4.6-any)MRTAnalysis_0.4.1.tgz(r-4.5-any)
MRTAnalysis_0.4.1.tar.gz(r-4.7-any)MRTAnalysis_0.4.1.tar.gz(r-4.6-any)
MRTAnalysis_0.4.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
MRTAnalysis/json (API)

# Install 'MRTAnalysis' in R:
install.packages('MRTAnalysis', repos = c('https://tqian.r-universe.dev', 'https://cloud.r-project.org'))
Datasets:

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

4.18 score 1 stars 38 scripts 286 downloads 17 exports 36 dependencies

Last updated from:ca29864ce9. Checks:2 NOTE, 7 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develNOTE137
source / vignettesOK226
linux-releaseOK168
macos-releaseOK244
macos-oldrelOK169
windows-develNOTE119
windows-releaseOK112
windows-oldrelOK121
wasm-releaseOK102

Exports:calculate_mrt_effect_sizedceeemeeemee2mceemcee_config_gammcee_config_glmmcee_config_knownmcee_config_lmmcee_config_makermcee_config_rangermcee_config_rfmcee_config_slmcee_config_sl_usermcee_generalmcee_userfit_nuisancewcls

Dependencies:backportsbootbroomclicpp11dplyrgeepackgenericsgluelatticelifecyclemagrittrMASSMatrixmgcvnlmepillarpkgconfigpurrrR6randomForestrangerRcppRcppEigenrlangrootSolvesandwichstringistringrtibbletidyrtidyselectutf8vctrswithrzoo

Standardized Proximal Effect Size in MRTAnalysis
Introduction | Data Structure | Example Data | Load the example MRT dataset | Estimate the Standardized Effect | Optional: Increase Bootstrap Replications | Plot the Estimated Effect

Last update: 2026-01-24
Started: 2026-01-24

Time-Varying Causal Excursion Effect Mediation in MRT: Continuous Distal Outcomes
1. Introduction | Estimation framework | Three user-facing wrappers | 2. Installation | 3. Quick Start Example | 4. A More Complex Data Example | Columns (Variables) | Peek at the included dataset | 5. Detailed Walkthrough of mcee | 5.1 Basic usage (GLM; constant effects) | 5.2 Time-varying effects (linear in dp) | 5.3 Other learners for nuisance fitting | 5.4 Estimating effects at specific decision points | 6. Testing for Linear Combinations of Coefficients | 6.1 Estimates $mcee_fit | 6.2 Linear combinations | Example 1: Difference $\alpha - \beta$ for constant‑effect model (fit1) | Example 2: Effects at decision point 10 for linear‑trend model (fit2) | 6.3 Inspecting nuisance models | 7. Other Wrappers: mcee_general and mcee_userfit_nuisance | 7.1 mcee_general | Example: flexible nuisance configs | 7.2 mcee_userfit_nuisance | Example: manual nuisance fits with GLM | 7.3 Comparing results | 8. Best Practices | 9. Conclusion | Appendix: Estimating Equations and Asymptotic Variance | Reference

Last update: 2025-09-09
Started: 2025-09-09

Exploratory Analysis for Micro-Randomized Trial (MRT): Continuous Distal Outcomes
Introduction | Data Structure of MRT with Distal Outcomes | Distal Causal Excursion Effects | Example Dataset | Using dcee() | Fully Marginal Effect (no moderators) | Moderated Effect | GAM nuisance models | Random Forest / Ranger nuisance | Cross-Fitting | Inspecting Stage-1 Fits | References

Last update: 2025-08-29
Started: 2025-08-29

Primary and Secondary Analysis for Micro-Randomized Trial (MRT): Proximal Outcomes
Introduction | Data Structure of an MRT | Availability | Prepare Your Data Set for Analysis | Causal Excursion Effect Estimation for MRT with Continuous Outcomes | Fully Marginal Causal Excursion Effect | Moderated Causal Excursion Effect | Causal Excursion Effect Estimation for MRT with Binary Outcomes | Bibliography | Reference

Last update: 2025-08-29
Started: 2025-08-29

Readme and manuals

Help Manual

Help pageTopics
Assert that input is a data frame.mcee_assert_df
Build basis matrix f(t) from time-varying effect formula.mcee_build_f_matrix
Build per-row weights omega(i,t) for MCEE estimation.mcee_build_weights
Validate binary column coding.mcee_check_binary_col
Validate control formula excludes treatment and outcome.mcee_check_control_formula
Check that decision points are strictly increasing within each subject.mcee_check_dp_strictly_increasing
Check config formula for inclusion/exclusion of mediator.mcee_check_formula_mediator
Check that rows for each subject appear in contiguous blocks.mcee_check_id_rows_grouped
Check data frame columns for missing/infinite values.mcee_check_no_missing_vars
Check numeric vector for missing/infinite values.mcee_check_no_missing_vec
Check that outcome is constant within each subject (required for distal outcomes).mcee_check_outcome_constant_within_id
Validate time-varying effect formula structure.mcee_check_time_varying_effect_form
Generate compact one-line description of nuisance model object.mcee_compact_model_info
Numerical core implementing MCEE estimation mathematics.mcee_core_rows
Select default GLM family based on nuisance parameter type.mcee_default_family
Remove a variable from RHS-only formula.mcee_drop_var_from_rhs
Fit a single nuisance component with flexible learner support.mcee_fit_nuisance
Print informative message if no availability column provided.mcee_message_if_no_availability_provided
Print formatted coefficient table for MCEE results.mcee_print_coef_table
Check that required columns exist in data frame.mcee_require_cols
Resolve randomization probability from column name or scalar.mcee_resolve_rand_prob
Validate clipping bounds for probability predictions.mcee_validate_clipping
Validate that learning method is supported.mcee_validate_method
Extract variables from nuisance configuration formula.mcee_vars_in_config
Extract variable names from RHS-only formula.mcee_vars_in_rhs
Calculate standardized proximal treatment effect across time (continuous outcomes)calculate_mrt_effect_size
A synthetic data set of an MRT with binary proximal outcomesdata_binary
A synthetic data set of an MRT with continuous distal outcomedata_distal_continuous
Example micro-randomized trial (MRT) data for standardized effect sizedata_example_for_standardized_effect
A synthetic data set that mimics the HeartSteps V1 data structure to illustrate the use of [wcls()] function for continuous proximal outcomesdata_mimicHeartSteps
Example longitudinal dataset with time-varying mediator and distal outcomedata_time_varying_mediator_distal_outcome
Distal Causal Excursion Effect (DCEE) Estimationdcee
Estimates the causal excursion effect for binary outcome MRTemee
Estimates the causal excursion effect for binary outcome MRTemee2
Mediated Causal Excursion Effects for MRTs (streamlined)mcee
Configure GAM for MCEE nuisance parametersmcee_config_gam
Configure GLM for MCEE nuisance parametersmcee_config_glm
Configure known constant values for MCEE nuisance parametersmcee_config_known
Configure linear model for MCEE nuisance parametersmcee_config_lm
Build a nuisance-configuration object for 'mcee_general()'mcee_config_maker
Configure Ranger Random Forest for MCEE nuisance parametersmcee_config_ranger
Configure Random Forest for MCEE nuisance parametersmcee_config_rf
Configure SuperLearner for MCEE nuisance parametersmcee_config_sl
Configure SuperLearner with user-specified library for MCEE nuisance parametersmcee_config_sl_user
Mediated Causal Excursion Effects (configurable nuisance models)mcee_general
Two-stage helper for mediated causal excursion effects (MCEE)mcee_helper_2stage_estimation
Fit all nuisance models for MCEE Stage 1mcee_helper_stage1_fit_nuisance
Stage-2 MCEE parameter estimation given nuisance predictionsmcee_helper_stage2_estimate_mcee
Mediated Causal Excursion Effects with user-supplied nuisance predictionsmcee_userfit_nuisance
Plot standardized proximal effect sizeplot.mrt_effect_size
Print method for summary of MCEE fitsprint.summary.mcee_fit
Summary for DCEE fitssummary.dcee_fit
Summarize Causal Excursion Effect Fits for MRT with Binary Outcomessummary.emee_fit
Summarize an mcee fitsummary.mcee_fit
Summary for standardized proximal effect sizesummary.mrt_effect_size
Summarize Causal Excursion Effect Fits for MRT with Continuous Outcomessummary.wcls_fit
Estimates the causal excursion effect for continuous outcome MRTwcls