  Stepped wedge cluster randomized trials (SWCRTs) often face challenges with
potential confounding by time trends. Traditional frequentist methods can fail
to provide adequate coverage of the intervention's true effect using confidence
intervals, whereas Bayesian approaches show potential for better coverage of
intervention effects. However, Bayesian methods have seen limited development
in SWCRTs. We propose two novel Bayesian hierarchical penalized spline models
for SWCRTs. The first model is for SWCRTs involving many clusters and time
periods, focusing on immediate intervention effects. To evaluate its efficacy,
we compared this model to traditional frequentist methods. We further developed
the model to estimate time-varying intervention effects. We conducted a
comparative analysis of this Bayesian spline model against an existing Bayesian
monotone effect curve model. The proposed models are applied in the Primary
Palliative Care for Emergency Medicine stepped wedge trial to evaluate the
effectiveness of primary palliative care intervention. Extensive simulations
and a real-world application demonstrate the strengths of the proposed Bayesian
models. The Bayesian immediate effect model consistently achieves near the
frequentist nominal coverage probability for true intervention effect,
providing more reliable interval estimations than traditional frequentist
models, while maintaining high estimation accuracy. The proposed Bayesian
time-varying effect model exhibits advancements over the existing Bayesian
monotone effect curve model in terms of improved accuracy and reliability. To
the best of our knowledge, this is the first development of Bayesian
hierarchical spline modeling for SWCRTs. The proposed models offer an accurate
and robust analysis of intervention effects. Their application could lead to
effective adjustments in intervention strategies.
