diff --git a/R/strategy_.R b/R/strategy_.R index 0b5b718..5e5ec6f 100644 --- a/R/strategy_.R +++ b/R/strategy_.R @@ -102,6 +102,16 @@ strategy_maic <- function(formula = NULL, } } } + # Ensure MAIC uses an unadjusted outcome model to prevent estimating conditional effects. + resp_var <- all.vars(outcome_model)[1] + out_vars <- all.vars(outcome_model) + + if (length(setdiff(out_vars, c(resp_var, trt_var))) > 0) { + if (verbatim) { + warning("Covariates detected in the MAIC outcome model. To ensure the estimation of compatible marginal treatment effects, MAIC requires an unadjusted outcome model. The outcome model is being automatically overridden to '", resp_var, " ~ ", trt_var, "'.", call. = FALSE) + } + outcome_model <- as.formula(paste(resp_var, "~", trt_var)) + } check_formula(outcome_model, trt_var) diff --git a/README.md b/README.md index 52edc0e..4c66977 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,7 @@ [![R-CMD-check](https://github.com/StatisticsHealthEconomics/outstandR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/StatisticsHealthEconomics/outstandR/actions/workflows/R-CMD-check.yaml) [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) -[![outstandR status -badge](https://statisticshealtheconomics.r-universe.dev/outstandR/badges/version)](https://statisticshealtheconomics.r-universe.dev/outstandR) +outstandR status badge [![CRAN status](https://www.r-pkg.org/badges/version/outstandR)](https://CRAN.R-project.org/package=outstandR) [![codecov](https://codecov.io/gh/StatisticsHealthEconomics/outstandR/graph/badge.svg?token=YOUR_CODECOV_TOKEN)](https://codecov.io/gh/StatisticsHealthEconomics/outstandR) diff --git a/_pkgdown.yml b/_pkgdown.yml index 4b6b2ff..7b4f1ac 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -83,14 +83,17 @@ reference: contents: - strategy-class -# articles: -# - title: "Binary outcome data example" -# contents: -# - "Binary_outcome_example" -# - title: "Continuous outcome data example" -# contents: -# - "Continuous_outcome_example" -# - title: "Count outcome data example" -# contents: -# - "Count_outcome_example" +articles: +- title: "Binary outcome data example" + contents: + - "Binary_outcome_example" +- title: "Continuous outcome data example" + contents: + - "Continuous_outcome_example" +- title: "Count outcome data example" + contents: + - "Count_outcome_example" +- title: "Developer Guides" + contents: + - "articles/adding-a-new-strategy" diff --git a/badge.svg b/badge.svg new file mode 100644 index 0000000..fe9d5de --- /dev/null +++ b/badge.svg @@ -0,0 +1,22 @@ + + + r-universe: 2.0.0 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index 553eed2..90580a3 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,8 +12,8 @@ - - + + diff --git a/docs/GEMINI.html b/docs/GEMINI.html index 8dc14f5..d9bda19 100644 --- a/docs/GEMINI.html +++ b/docs/GEMINI.html @@ -1,5 +1,5 @@ -outstandR: Outcome Regression Standardisation • outstandR +outstandR: Outcome Regression Standardisation • outstandR Skip to contents diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 04cba1c..4056cb5 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,5 +1,5 @@ -GNU General Public License • outstandR +GNU General Public License • outstandR Skip to contents diff --git a/docs/articles/Binary_outcome_example.html b/docs/articles/Binary_outcome_example.html index 31a162a..bd888c3 100644 --- a/docs/articles/Binary_outcome_example.html +++ b/docs/articles/Binary_outcome_example.html @@ -1,11 +1,16 @@ - + Binary data example • outstandR + + + + + @@ -16,11 +21,11 @@ Skip to contents -