run_simulations_par_dom.Rd
This function simulates a parallel-group trial across multiple iterations. It evaluates equivalence across multiple endpoints using the Difference of Means (DOM) test.
run_simulations_par_dom(
nsim,
n,
muT,
muR,
SigmaT,
SigmaR,
lequi_tol,
uequi_tol,
alpha,
dropout,
typey,
adseq,
k,
arm_seed_T,
arm_seed_R,
TART,
TARR,
vareq
)
Integer. The number of simulations to run.
Integer. The sample size per arm (before dropout).
arma::vec. Mean vector for the treatment arm.
arma::vec. Mean vector for the reference arm.
arma::mat. Covariance matrix for the treatment arm.
arma::mat. Covariance matrix for the reference arm.
arma::rowvec. Lower equivalence thresholds for each endpoint.
arma::rowvec. Upper equivalence thresholds for each endpoint.
arma::rowvec. Significance level for each endpoint.
arma::vec. Dropout rates for each arm (T, R).
Integer vector indicating the classification of each endpoint, where 1
corresponds to a primary endpoint and 2
corresponds to a secondary endpoint.
Boolean. If TRUE
, applies sequential (hierarchical) testing.
Integer. Minimum number of endpoints required for equivalence.
arma::ivec. Random seed vector for the treatment group (one per simulation).
arma::ivec. Random seed vector for the reference group (one per simulation).
Double. Treatment allocation ratio (proportion of subjects in treatment arm).
Double. Reference allocation ratio (proportion of subjects in reference arm).
Boolean. If TRUE
, assumes equal variances across treatment and reference groups.
The function returns an arma::mat storing simulation results row-wise for consistency
with R's output format. The first row (totaly
) contains the overall equivalence decision
(1 for success, 0 for failure). The subsequent rows include equivalence deicisons for each endpoint,
mean estimates for both treatment and reference groups, and corresponding standard deviations.
Equivalence testing uses either the Difference of Means (DOM) test,
applying predefined equivalence thresholds and significance levels. When hierarchical testing (adseq
)
is enabled, all primary endpoints must demonstrate equivalence before secondary endpoints are evaluated.
Dropout rates are incorporated into the sample size calculation to ensure proper adjustment.
Randomization is controlled through separate random seeds for the treatment and reference groups,
enhancing reproducibility.