CARAEE_Sim: Simulation Function of of CARA Designs Based on Efficiency...

View source: R/CARA_function.R

CARAEE_SimR Documentation

Simulation Function of of CARA Designs Based on Efficiency and Ethics for Binary and Continuous Response.

Description

This function simulates a clinical trial using CARA Designs Based on Efficiency and Ethics (CARAEE) with Binary or Continuous Responses.

Usage

CARAEE_Sim(n, thetaA, thetaB, m0 = 40, pts.cov, response, gamma)

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.

response

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

gamma

a non-negative number. A tuning parameter that reflects the importance of the efficiency component compared to the ethics component.

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 = CARAEE_Sim(n = 400,
                     pts.cov = cbind(rnorm(400), rnorm(400)),
                     thetaA = c(-1, 1, 1),
                     thetaB = c(3, 1, 1),
                     response = "Binary",
                     gamma=1)

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

Related to CARAEE_Sim in caradpt...