CADBCD_Sim: Simulation Function of Covariate Adjusted Doubly Biased Coin...

View source: R/CARA_function.R

CADBCD_SimR Documentation

Simulation Function of Covariate Adjusted Doubly Biased Coin Design for Binary and Continuous Response

Description

This function simulates a clinical trial using the Covariate Adjusted Doubly Biased Coin Design (CADBCD) with Binary or Continuous Responses.

Usage

CADBCD_Sim(n, thetaA, thetaB, m0 = 40, pts.cov, v = 2, response, target)

Arguments

n

a positive integer. The value specifies the total number of participants involved in each round of the simulation.

thetaA

a vector of length k+1. The true coefficient parameter value for treatment A.

thetaB

a vector of length k+1. The true coefficient parameter value for treatment B.

m0

a positive integer. The number of first 2m0 patients will be allocated equally for estimation. The default value is 40.

pts.cov

a n x k matrix. The simulated covariate matrix for patients.

v

a non-negative integer that controls the randomness of CADBCD design. The default value is 2.

response

the type of the response. Options are "Binary" or "Cont".

target

the type of optimal allocation target. Options are "Neyman" or "RSIHR".

Value

A list with the following elements:

method

The name of the procedure.

sampleSize

Total number of patients.

parameter

Estimated parameter values.

assignment

Treatment assignment vector.

proportion

Proportion of patients allocated to treatment A.

responses

Simulated response values.

failureRate

Proportion of treatment failures (if response = "Binary").

meanResponse

Mean response value (if response = "Cont").

rejectNull

Logical. Indicates whether the treatment effect is statistically significant based on a Wald test.

Examples

set.seed(123)
results = CADBCD_Sim(n = 400,
                      pts.cov = cbind(rnorm(400), rnorm(400)),
                      thetaA = c(-1, 1, 1),
                      thetaB = c(3, 1, 1),
                      response = "Binary",
                      target = "Neyman")
results

## view the settings
results$method
results$sampleSize

## view the simulation results
results$parameter
results$assignments
results$proportion
results$responses
results$failureRate


caradpt documentation built on Aug. 28, 2025, 9:09 a.m.

Related to CADBCD_Sim in caradpt...