From 45c511f61d3e617c97e847bcb995f8976bd91c97 Mon Sep 17 00:00:00 2001 From: Dr Nathan Green Date: Thu, 29 Aug 2024 16:09:55 +0100 Subject: [PATCH] new build --- NAMESPACE | 2 ++ R/mim.R | 6 +++--- man/IPD_stats.Rd | 7 +++++++ man/mim.Rd | 16 ++++++++++++++++ man/outstandR.Rd | 2 +- man/strategy.Rd | 9 +++++++++ 6 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 man/mim.Rd diff --git a/NAMESPACE b/NAMESPACE index d3a1ac4..d87c877 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -4,6 +4,7 @@ S3method(IPD_stats,default) S3method(IPD_stats,gcomp_ml) S3method(IPD_stats,gcomp_stan) S3method(IPD_stats,maic) +S3method(IPD_stats,mim) S3method(IPD_stats,stc) export(ALD_stats) export(IPD_stats) @@ -14,6 +15,7 @@ export(outstandR) export(strategy_gcomp_ml) export(strategy_gcomp_stan) export(strategy_maic) +export(strategy_mim) export(strategy_stc) export(trial_treatment_effect) export(trial_variance) diff --git a/R/mim.R b/R/mim.R index f4d3fe4..0a48d3e 100644 --- a/R/mim.R +++ b/R/mim.R @@ -6,10 +6,10 @@ #' mim <- function(ipd.index, ipd.target, - M = 1, + M = 1000, n.chains = 2, - warmup = 10, - iters = 1000) { + warmup = 1000, + iters = 4000) { ## SYNTHESIS STAGE ## diff --git a/man/IPD_stats.Rd b/man/IPD_stats.Rd index 0cb8601..bd1bff7 100644 --- a/man/IPD_stats.Rd +++ b/man/IPD_stats.Rd @@ -7,6 +7,7 @@ \alias{IPD_stats.stc} \alias{IPD_stats.gcomp_ml} \alias{IPD_stats.gcomp_stan} +\alias{IPD_stats.mim} \title{Calculate individual-level patient data statistics} \usage{ IPD_stats(strategy, ipd, ald, ...) @@ -20,6 +21,8 @@ IPD_stats(strategy, ipd, ald, ...) \method{IPD_stats}{gcomp_ml}(strategy, ipd, ald) \method{IPD_stats}{gcomp_stan}(strategy, ipd, ald) + +\method{IPD_stats}{mim}(strategy, ipd, ald) } \arguments{ \item{strategy}{A list corresponding to different approaches} @@ -61,3 +64,7 @@ Using Stan, compute marginal log-odds ratio for \emph{A} vs \emph{C} for each MC by transforming from probability to linear predictor scale. } +\section{Multiple imputation marginalisation}{ + +} + diff --git a/man/mim.Rd b/man/mim.Rd new file mode 100644 index 0000000..4e843b2 --- /dev/null +++ b/man/mim.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/mim.R +\name{mim} +\alias{mim} +\title{Multiple imputation marginalization (MIM)} +\usage{ +mim(ipd.index, ipd.target, M = 1000, n.chains = 2, warmup = 1000, iters = 4000) +} +\arguments{ +\item{ipd.index, ipd.target}{Index RCT and target covariate datasets} + +\item{M}{Number of syntheses used in analysis stage (high for low Monte Carlo error)} +} +\description{ +Multiple imputation marginalization (MIM) +} diff --git a/man/outstandR.Rd b/man/outstandR.Rd index 89b3ef5..7ea99f7 100644 --- a/man/outstandR.Rd +++ b/man/outstandR.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ModStanR.R +% Please edit documentation in R/outstandR.R \name{outstandR} \alias{outstandR} \title{Calculate the difference between treatments using all evidence} diff --git a/man/strategy.Rd b/man/strategy.Rd index 8bc2e89..1e5c0ed 100644 --- a/man/strategy.Rd +++ b/man/strategy.Rd @@ -5,6 +5,7 @@ \alias{strategy_stc} \alias{strategy_gcomp_ml} \alias{strategy_gcomp_stan} +\alias{strategy_mim} \alias{strategy} \alias{new_strategy} \title{New strategy objects} @@ -17,6 +18,8 @@ strategy_gcomp_ml(formula = NULL, R = 1000) strategy_gcomp_stan(formula = NULL) +strategy_mim(formula = NULL) + new_strategy(strategy, ...) } \arguments{ @@ -38,6 +41,8 @@ new_strategy(strategy, ...) \code{gcomp_ml} class object \code{gcomp_stan} class object + +\code{mim} class object } \description{ Create a type of strategy class for each modelling approach. @@ -140,3 +145,7 @@ In practice, the integrals above can be approximated numerically, using full Bay estimation via Markov chain Monte Carlo (MCMC) sampling. } +\section{Multiple imputation marginalization (MIM)}{ + +} +