run_simulations_2x2_dom.Rd
This function simulates a 2x2 crossover trial across multiple iterations. It evaluates equivalence across multiple endpoints using the Difference of Means (DOM) test.
run_simulations_2x2_dom(
nsim,
n,
muT,
muR,
SigmaW,
lequi_tol,
uequi_tol,
alpha,
sigmaB,
dropout,
Eper,
Eco,
typey,
adseq,
k,
arm_seed
)
Integer. The number of simulations to run.
Integer. The sample size per period.
Numeric vector. Mean outcomes for the active treatment.
Numeric vector. Mean outcomes for the reference treatment.
Numeric matrix. Within-subject covariance matrix for endpoints.
Numeric vector. Lower equivalence thresholds for each endpoint.
Numeric vector. Upper equivalence thresholds for each endpoint.
Numeric vector. Significance levels for hypothesis testing across endpoints.
Numeric. Between-subject variance for the crossover model.
Numeric vector of size 2. Dropout rates for each sequence.
Numeric vector. Expected period effects for each sequence.
Numeric vector. Expected carryover effects for each sequence.
Integer vector indicating the classification of each endpoint, where 1
corresponds to a primary endpoint and 2
corresponds to a secondary endpoint.
Logical. If TRUE
, applies sequential (hierarchical) testing.
Integer. Minimum number of endpoints required for equivalence.
Integer vector. Random seed for each simulation.
A numeric matrix where each column stores simulation results:
The first row (totaly
) represents the overall equivalence decision (1 = success, 0 = failure).
Subsequent rows contain equivalence decisions per endpoint,
mean estimates for the treatment group, mean estimates for the reference group,
standard deviations for treatment, and standard deviations for reference.
This function evaluates equivalence using the Difference of Means (DOM) test.
Equivalence is determined based on predefined lower (lequi_tol
) and upper (uequi_tol
) equivalence thresholds,
and hypothesis testing is conducted at the specified significance level (alpha
).
If adseq
is TRUE
, primary endpoints must establish equivalence before secondary endpoints are evaluated.
The sample size per period is adjusted based on dropout rates, ensuring valid study conclusions.
The simulation incorporates within-subject correlation using SigmaW
and accounts for between-subject variance with sigmaB
.
Expected period effects (Eper
) and carryover effects (Eco
) are included in the model.
A fixed random seed (arm_seed
) is used to ensure reproducibility across simulations.