From e65dcf32aa93b8de807fbd2ce64815f6372ec962 Mon Sep 17 00:00:00 2001 From: Craig Gower-Page Date: Thu, 25 Jan 2024 11:37:49 +0000 Subject: [PATCH] Add FAQ vignette (#407) Closes #389 --- NEWS.md | 4 + vignettes/FAQ.Rmd | 103 +++++++++ vignettes/FAQ.asis | 2 + vignettes/FAQ.html | 458 +++++++++++++++++++++++++++++++++++++++ vignettes/build.R | 5 + vignettes/references.bib | 11 + 6 files changed, 583 insertions(+) create mode 100644 vignettes/FAQ.Rmd create mode 100644 vignettes/FAQ.asis create mode 100644 vignettes/FAQ.html diff --git a/NEWS.md b/NEWS.md index e1985ecb..9b05e62b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,8 @@ +# rbmi (development version) + +* Added FAQ vignette + # rbmi 1.2.6 * Updated unit tests to fix false-positive error on CRAN's testing servers diff --git a/vignettes/FAQ.Rmd b/vignettes/FAQ.Rmd new file mode 100644 index 00000000..69d8c140 --- /dev/null +++ b/vignettes/FAQ.Rmd @@ -0,0 +1,103 @@ +--- +title: "rbmi: Frequently Asked Questions" +author: Alessandro Noci, Craig Gower-Page and Marcel Wolbers +output: + bookdown::html_document2: + toc: true + toc_depth: 4 + number_sections: true + citation_package: natbib + base_format: rmarkdown::html_vignette +bibliography: "references.bib" +link-citations: true +pkgdown: + as_is: true +linkcolor: blue +vignette: > + %\VignetteIndexEntry{rbmi: Frequently Asked Questions} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +# Introduction + +This document provides answers to common questions about the `rbmi` package. +It is intended to be read after the `rbmi: Quickstart` vignette. + +
+ +## How do the methods in `rbmi` compare to the mixed model for repeated measures (MMRM) implemented in the `mmrm` package? + +`rbmi` was designed to complement and, occasionally, replace standard MMRM analyses for clinical trials with longitudinal endpoints. + +**Strengths** of `rbmi` compared to the standard MMRM model are: + +- `rbmi` was designed to allow for analyses which are fully aligned with the the estimand definition. To facilitate this, it implements methods under a range of different missing data assumptions including standard missing-at-random (MAR), extended MAR (via inclusion of time-varying covariates), reference-based missingness, and not missing-at-random at random (NMAR; via $\delta$-adjustments). In contrast, the standard MMRM model is only valid under a standard MAR assumption which is not always plausible. For example, the standard MAR assumption is rather implausible for implementing a treatment policy strategy for the intercurrent event "treatment discontinuation" if a substantial proportion of subjects are lost-to-follow-up after discontinuation. +- The $\delta$-adjustment methods implemented in `rbmi` can be used for sensitivity analyses of a primary MMRM- or rbmi-type analysis. + +**Weaknesses** of `rbmi` compared to the standard MMRM model are: + +- MMRM models have been the de-facto standard analysis method for more than a decade. `rbmi` is currently less established. +- `rbmi` is computationally more intensive and using it requires more careful planning. + +
+ +## How does `rbmi` compare to general-purpose software for multiple imputation (MI) such as `mice`? + +`rbmi` covers only "MMRM-type" settings, i.e. settings with a single longitudinal continuous outcome which may be missing at some visits and hence require imputation. + +For these settings, it has several **advantages** over general-purpose MI software: + +- `rbmi` supports imputation under a range of different missing data assumptions whereas general-purpose MI software is mostly focused on MAR-based imputation. In particular, it is unclear how to implement jump to reference (JR) or copy increments in reference (CIR) methods with such software. +- The `rbmi` interface is fully streamlined to this setting which arguably makes the implementation more straightforward than for general-purpose MI software. +- The MICE algorithm is stochastic and inference is always based on Rubin's rules. In contrast, method "conditional mean imputation plus jackknifing" (`method="method_condmean(type = "jackknife")"`) in `rbmi` does not require any tuning parameters, is fully deterministic, and provides frequentist-consistent inference also for reference-based imputations (where Rubin's rule is very conservative leading to actual type I error rates which can be far below their nominal values). + +However, `rbmi` is much more limited in its functionality than general-purpose MI software. + +
+ +## How to handle missing data in baseline covariates in `rbmi`? + +`rbmi` does not support imputation of missing baseline covariates. Therefore, missing baseline covariates need to be handled outside of `rbmi`. +The best approach for handling missing baseline covariates needs to be made on a case-by-case basis but in the context of randomized trials, relatively simple approach are often sufficient (@White2005). + +
+ +## Why does `rbmi` by default use an ANCOVA analysis model and not an MMRM analysis model? + +The theoretical justification for the conditional mean imputation method requires that the analysis model leads to a point estimator which is a linear function of the outcome vector (@Wolbers2021). This is the case for ANCOVA but not for general MMRM models. For the other imputation methods, both ANCOVA and MMRM are valid analysis methods. An MMRM analysis model could be implemented by providing a custom analysis function to the `analyse()` function. + +For further expalanations, we also cite the end of section 2.4 of the conditional mean imputation paper (@Wolbers2021): + +> The proof relies on the fact that the ANCOVA estimator is a linear function of the outcome vector. +> **For complete data, the ANCOVA estimator leads to identical parameter estimates as an MMRM model** of all longitudinal outcomes with an arbitrary common covariance structure across treatment groups **if treatment-by-visit interactions as well as covariate-by-visit-interactions** are included in the analysis model for all covariates,17 (p. 197). +> Hence, the same proof also applies to such MMRM models. +> We expect that conditional mean imputation is also valid if a general MMRM model is used for the analysis but more involved argument would be required to formally justify this. + +
+ +## How can I analyse the change-from-baseline in the analysis model when imputation was done on the original outcomes? + +This can be achieved using custom analysis functions as outlined in Section 7 of the Advanced Vignette. e.g. + +```r +ancova_modified <- function(data, ...) { + data2 <- data %>% mutate(ENDPOINT = ENDPOINT - BASELINE) + rbmi::ancova(data2, ...) +} + +anaObj <- rbmi::analyse( + imputeObj, + ancova_modified, + vars = vars + ) +``` + +
diff --git a/vignettes/FAQ.asis b/vignettes/FAQ.asis new file mode 100644 index 00000000..be734985 --- /dev/null +++ b/vignettes/FAQ.asis @@ -0,0 +1,2 @@ +%\VignetteIndexEntry{rbmi: Frequently Asked Questions} +%\VignetteEngine{R.rsp::asis} diff --git a/vignettes/FAQ.html b/vignettes/FAQ.html new file mode 100644 index 00000000..2b7eaf3f --- /dev/null +++ b/vignettes/FAQ.html @@ -0,0 +1,458 @@ + + + + + + + + + + + + + + + +rbmi: Frequently Asked Questions + + + + + + + + + + + + + + + + + + + + + + + + + + +

rbmi: Frequently Asked Questions

+

Alessandro Noci, Craig Gower-Page and Marcel Wolbers

+ + +
+ +
+ +
+

1 Introduction

+

This document provides answers to common questions about the rbmi package. +It is intended to be read after the rbmi: Quickstart vignette.

+


+
+

1.1 How do the methods in rbmi compare to the mixed model for repeated measures (MMRM) implemented in the mmrm package?

+

rbmi was designed to complement and, occasionally, replace standard MMRM analyses for clinical trials with longitudinal endpoints.

+

Strengths of rbmi compared to the standard MMRM model are:

+
    +
  • rbmi was designed to allow for analyses which are fully aligned with the the estimand definition. To facilitate this, it implements methods under a range of different missing data assumptions including standard missing-at-random (MAR), extended MAR (via inclusion of time-varying covariates), reference-based missingness, and not missing-at-random at random (NMAR; via \(\delta\)-adjustments). In contrast, the standard MMRM model is only valid under a standard MAR assumption which is not always plausible. For example, the standard MAR assumption is rather implausible for implementing a treatment policy strategy for the intercurrent event “treatment discontinuation” if a substantial proportion of subjects are lost-to-follow-up after discontinuation.
  • +
  • The \(\delta\)-adjustment methods implemented in rbmi can be used for sensitivity analyses of a primary MMRM- or rbmi-type analysis.
  • +
+

Weaknesses of rbmi compared to the standard MMRM model are:

+
    +
  • MMRM models have been the de-facto standard analysis method for more than a decade. rbmi is currently less established.
  • +
  • rbmi is computationally more intensive and using it requires more careful planning.
  • +
+


+
+
+

1.2 How does rbmi compare to general-purpose software for multiple imputation (MI) such as mice?

+

rbmi covers only “MMRM-type” settings, i.e. settings with a single longitudinal continuous outcome which may be missing at some visits and hence require imputation.

+

For these settings, it has several advantages over general-purpose MI software:

+
    +
  • rbmi supports imputation under a range of different missing data assumptions whereas general-purpose MI software is mostly focused on MAR-based imputation. In particular, it is unclear how to implement jump to reference (JR) or copy increments in reference (CIR) methods with such software.
  • +
  • The rbmi interface is fully streamlined to this setting which arguably makes the implementation more straightforward than for general-purpose MI software.
  • +
  • The MICE algorithm is stochastic and inference is always based on Rubin’s rules. In contrast, method “conditional mean imputation plus jackknifing” (method="method_condmean(type = "jackknife")") in rbmi does not require any tuning parameters, is fully deterministic, and provides frequentist-consistent inference also for reference-based imputations (where Rubin’s rule is very conservative leading to actual type I error rates which can be far below their nominal values).
  • +
+

However, rbmi is much more limited in its functionality than general-purpose MI software.

+


+
+
+

1.3 How to handle missing data in baseline covariates in rbmi?

+

rbmi does not support imputation of missing baseline covariates. Therefore, missing baseline covariates need to be handled outside of rbmi. +The best approach for handling missing baseline covariates needs to be made on a case-by-case basis but in the context of randomized trials, relatively simple approach are often sufficient (White and Thompson (2005)).

+


+
+
+

1.4 Why does rbmi by default use an ANCOVA analysis model and not an MMRM analysis model?

+

The theoretical justification for the conditional mean imputation method requires that the analysis model leads to a point estimator which is a linear function of the outcome vector (Wolbers et al. (2022)). This is the case for ANCOVA but not for general MMRM models. For the other imputation methods, both ANCOVA and MMRM are valid analysis methods. An MMRM analysis model could be implemented by providing a custom analysis function to the analyse() function.

+

For further expalanations, we also cite the end of section 2.4 of the conditional mean imputation paper (Wolbers et al. (2022)):

+
+

The proof relies on the fact that the ANCOVA estimator is a linear function of the outcome vector. +For complete data, the ANCOVA estimator leads to identical parameter estimates as an MMRM model of all longitudinal outcomes with an arbitrary common covariance structure across treatment groups if treatment-by-visit interactions as well as covariate-by-visit-interactions are included in the analysis model for all covariates,17 (p. 197). +Hence, the same proof also applies to such MMRM models. +We expect that conditional mean imputation is also valid if a general MMRM model is used for the analysis but more involved argument would be required to formally justify this.

+
+


+
+
+

1.5 How can I analyse the change-from-baseline in the analysis model when imputation was done on the original outcomes?

+

This can be achieved using custom analysis functions as outlined in Section 7 of the Advanced Vignette. e.g.

+
ancova_modified <- function(data, ...) {
+    data2 <- data %>% mutate(ENDPOINT = ENDPOINT - BASELINE)
+    rbmi::ancova(data2, ...)
+}
+
+anaObj <- rbmi::analyse(
+    imputeObj,
+    ancova_modified,
+    vars = vars
+ )
+


+
+
+White, Ian R, and Simon G Thompson. 2005. “Adjusting for Partially Missing Baseline Measurements in Randomized Trials.” Statistics in Medicine 24 (7): 993–1007. +
+
+Wolbers, Marcel, Alessandro Noci, Paul Delmar, Craig Gower-Page, Sean Yiu, and Jonathan W. Bartlett. 2022. “Standard and Reference-Based Conditional Mean Imputation.” Pharmaceutical Statistics. https://doi.org/10.1002/pst.2234. +
+
+
+
+ + + + + + + + + + + diff --git a/vignettes/build.R b/vignettes/build.R index b5d83f3e..5ac313ce 100644 --- a/vignettes/build.R +++ b/vignettes/build.R @@ -25,3 +25,8 @@ rmarkdown::render( output_file = "advanced.html" ) +rmarkdown::render( + input = "./vignettes/FAQ.Rmd", + output_dir = "./vignettes/", + output_file = "FAQ.html" +) diff --git a/vignettes/references.bib b/vignettes/references.bib index bca3b135..524afcd5 100644 --- a/vignettes/references.bib +++ b/vignettes/references.bib @@ -408,6 +408,17 @@ @article{Wang1998 publisher={Oxford University Press} } +@article{White2005, + title={Adjusting for partially missing baseline measurements in randomized trials}, + author={White, Ian R and Thompson, Simon G}, + journal={Statistics in medicine}, + volume={24}, + number={7}, + pages={993--1007}, + year={2005}, + publisher={Wiley Online Library} +} + @article{White2020causal, title={A causal modelling framework for reference-based imputation and tipping point analysis in clinical trials with quantitative outcome}, author={White, Ian and Royes, Joseph and Best, Nicky},