futilityAnalysis: Futility Analysis Across Interventions for CRT, MST, or SRT...

View source: R/futilityAnalysis.R

futilityAnalysisR Documentation

Futility Analysis Across Interventions for CRT, MST, or SRT Designs

Description

This function performs a Bayesian futility analysis for each intervention group compared to control, across cluster randomized trials (CRT), multisite trials (MST) or simple randomized trials (SRT).

Usage

futilityAnalysis(
  method = c("crt", "mst", "srt"),
  data,
  outcome = "posttest",
  interventions = "interventions",
  Random = "schools",
  Nsim = 10000,
  Threshold = 0.05,
  FutThreshold = 0.8,
  continuous_covariates = NULL,
  categorical_covariates = NULL
)

Arguments

method

The trial design type: "crt", "mst", or "srt".

data

A data frame containing the variables including outcome, predictors, the clustering variable, and the intervention.

outcome

The name of the outcome (post-test) variable.

interventions

A string specifying the intervention variable.

Random

The name of the clustering variable (e.g., schools or sites) for CRT and MST designs.

Nsim

Number of MCMC iterations to be performed. A minimum of 10,000 is recommended to ensure convergence.

Threshold

The effect size threshold for posterior computation (default = 0.05).

FutThreshold

The minimum posterior probability threshold for non-futility (default = 0.8).

continuous_covariates

A character vector specifying the names of continuous covariates.

categorical_covariates

A character vector specifying the names of categorical covariates (converted to factors).

Details

The function loops over each intervention, fits the appropriate Bayesian model (crtBayes, mstBayes, srtBayes), extracts the posterior probability, and determines futility based on the specified probability threshold.

Value

A data.frame with columns:

  • Intervention: Intervention group identifier.

  • Futility: 1 if considered futile (posterior probability < FutThreshold), 0 otherwise.

  • ProbES: Bayesian posterior probabilities that the observed effect size is greater than or equal to a pre-specified threshold

See Also

crtBayes, mstBayes, srtBayes functions from the eefAnalytics package

Examples


###Futility analysis of cluster randomized trial###
data(crt4armSimData)
futilityAnalysis(method = "crt", data = crt4armSimData, outcome = "posttest", 
interventions = "interventions", Random = "schools", Nsim = 10000, 
Threshold = 0.05, FutThreshold = 0.8,continuous_covariates = c("pretest"),
categorical_covariates = c("gender", "ethnicity"))

###Futility analysis of multisite trial###
data(mst4armSimData)
futilityAnalysis(method = "mst", data = mst4armSimData, outcome = "posttest",
interventions = "interventions", Random = "schools", Nsim = 10000, 
Threshold = 0.05, FutThreshold = 0.8,continuous_covariates = c("pretest"),
categorical_covariates = c("gender", "ethnicity"))

###Futility analysis of simple randomized trial###
data(srt4armSimData)
futilityAnalysis(method = "srt", data = srt4armSimData, outcome = "posttest",
interventions = "interventions", Nsim = 10000, Threshold = 0.05, FutThreshold = 0.8,
continuous_covariates = c("pretest"), categorical_covariates = c("gender", "ethnicity"))



epts documentation built on June 8, 2025, 11:04 a.m.

Related to futilityAnalysis in epts...