Shiny apps for simulating designs
On the importance of control group: parallel two-arms clinical trial with non-especific effects (normallity distributed outcome)
In a simple two-arm clinical trial without baseline measurements, differences observed at the end of the study may be influenced by pre-existing imbalances rather than the treatment effect itself. Without accounting for participants’ initial status, natural variability, regression to the mean, and unequal prognostic factors across groups can bias estimates and reduce statistical power. This increases the risk of incorrect conclusions—either overstating a treatment benefit or missing a true effect. Including baseline measurements allows adjustment for these differences, improving precision and the validity of the trial’s results.
Two-arms parallel clinical trial with binary outcome
In a two-arm design with a binary outcome, the choice between superiority, equivalence, and non-inferiority frameworks determines how treatment effects are evaluated.
-
Superiority trials aim to show that a new intervention performs significantly better than the control, typically testing whether the difference in event rates exceeds zero in a favorable direction.
-
Equivalence trials evaluate whether the difference between groups is small enough to conclude the treatments are clinically indistinguishable, requiring both upper and lower bounds of the difference to fall within a predefined equivalence margin.
-
Non-inferiority trials test whether the new treatment is not unacceptably worse than the control by more than a specified margin, prioritizing benefits such as safety, cost, or practicality over a proven efficacy gain.
Clear definition of the hypothesis and margins is critical, as these directly influence sample size, interpretation, and regulatory acceptance of the results.
Parallel multi-arm clinical trial with normally distributed outcome (one-way ANOVA)
In a parallel multi-arm trial, several treatments are compared simultaneously, usually against a common control. With a continuous outcome, one-way ANOVA provides a straightforward framework to test whether any of the treatments differ in mean effect. By modeling treatment as a single factor, ANOVA assesses overall differences while controlling the Type I error rate for the global hypothesis. If significant, post-hoc pairwise comparisons help identify which treatments differ. This design increases efficiency by evaluating multiple interventions within the same study population and improves evidence-based decision-making when several promising options exist.
Multicentric clinical trial for evaluating a parallel multi-arm trial (Randomized Compkete Block Design: RCBD)
In a parallel multi-arm clinical trial—such as a multicenter study—multiple treatments are evaluated simultaneously against a common control or against each other. This design improves efficiency by sharing resources and participants, but also increases the risk of center-to-center variability and imbalance in key prognostic factors. Incorporating blocking (e.g., by study center or other relevant stratifiers) ensures that each treatment group is well represented within each block, reducing confounding from site-specific differences such as patient characteristics, clinical practice, or outcome assessment. Proper blocking enhances comparability between arms, improves precision, and supports valid inference across a diverse trial population.
Two-arm (Treatment vs. Control) longitudinal study with repeated measurements (subject variability) and replicate measurements for each time and subject (mixed model)
In a two-arm longitudinal trial with repeated outcome measurements, each participant is followed across multiple time points to capture changes over the course of treatment. When subject-specific variability is expected and replicate measurements are taken at each time point, a mixed-effects model offers a robust analytical framework. It separates between-subject and within-subject sources of variation, accommodates incomplete follow-up, and accounts for correlation among repeated observations. This approach increases precision in estimating treatment effects over time and enables the evaluation of treatment–time interactions, providing deeper insight into how treatment response evolves during the study.
Longitudinal trial comparing several treatments and repeated measurements for each subject at different sessions (no replicates). Include subject variability (mixed model)
In a longitudinal multi-arm clinical trial, participants are randomized to several treatments and followed over multiple sessions to assess how responses evolve. With repeated measurements on each subject (but no replicates per session), outcomes are correlated within individuals. A mixed-effects model accounts for this dependency by incorporating random subject effects, capturing individual variability in baseline levels and progression over time. This approach improves accuracy in estimating treatment differences, allows testing treatment–time interactions, and handles missing observations more effectively than traditional repeated-measures ANOVA.
Two-arms longitudinal trial and repeated measurements for each subject (continous time): Using splines
In a two-arm longitudinal trial with repeated outcomes measured over continuous time, treatment effects may evolve in a nonlinear way. Instead of assuming a rigid parametric trend, spline-based mixed-effects models provide flexible curves that adapt to the data while preserving smoothness. By modeling time with splines and including random subject effects, the approach accounts for within-subject correlation and captures individual trajectories. This framework supports estimation of complex treatment–time interaction patterns, improves model fit when changes are not linear, and enables more realistic interpretation of treatment dynamics throughout follow-up.
Repeated Latin squares designs: mixed models with control for two random factors
In a repeated Latin square design, each treatment appears exactly once in every row and every column, balancing two nuisance sources of variation (e.g., subjects and periods, or centers and operators). When the trial includes replications of the Latin square, variability across these factors should be modeled appropriately. A mixed-effects model allows treatment to be evaluated as a fixed effect while treating both row and column effects—and their replication—as random factors. This approach accounts for correlation within the structured layout, improves precision in estimating treatment differences, and supports valid inference even when data are unbalanced or include missing observations.
Nested designs
In a nested design, experimental units are arranged in hierarchical levels where lower-level units exist only within specific higher-level groups (e.g., patients nested within clinics, or measurements nested within subjects). Because variability is introduced at each level of the hierarchy, a mixed-effects model is typically used: fixed effects estimate treatment differences, while random effects capture between-group and within-group variability. Properly modeling the nested structure prevents inflated Type I error, improves precision, and ensures valid inference when units are not exchangeable across higher-level groups.