help for itspower

Title

itspower -- Simulation based power calculations for linear interrupted time series (ITS) designs

Syntax

itspower
, sn(#) nuts(#) prepoints(#) lvlmn(#) corr(string) sd(string) [optional]

required
sn(#) Number of simulations to execute

nuts(#) Number of units (e.g. patients or general practices)

prepoints(#) Number of pre-interention time-points

lvlmn(#) Mean level change assumption for the 1st time point post-intervention

corr(string) Correlation matrix

sd(string) Standard deviation matrix

optional
lvlsd(#) Standard deviation for the level change

clvl(#) Set alpha level

seed(#) Set seed number

moreon Set more on (default is off)

Description

itspower is a simulations-based command that calculates power for linear interrupted time series (ITS) designs.
The command proceeds in two steps. First, it generates the outcome data according to the specified inputs and then uses
linear regression modelling (defining panel data with xtset and analysing the time-series using xtreg) to
estimate the power for the model to detect the specified level change. Level change is defined as the increase above
(or decrease below) the expected overall mean, for the time-point following the intervention.
Power indicates the percentage of iterations in which the level change was found to be statistically significant and of
the same direction as the hypothesised. The 95% confidence interval (as default), or any other confidence interval as
specified by option clvl(#), for the power is also reported.

Note that the level of the outcome or the pre-intervention trend are irrelevant, at least for power calculations for the
level change in the first post-intervention time point. In the future the command may be expanded to include power calculation
for the slope change post-intervention, if requested by users (for which the pre-intervention trend will be relevant).

Also note that the simulations assume no autocorrelation/seasonality. In other words, if you plan to analyse using an ARIMA
model and expect or can measure seasonality, do not use this command since it is assuming linearity.

Required

sn(#) Number (integer) of simulations to execute. At least 1000 are recommended for relatively narrow confidence intervals.

nuts(#) Number (integer) of units. For example, general practices in England.

prepoints(#) Number (integer) of pre-intervention time-points. The minimum allowed is two.

lvlmn(#) Mean level change (real) for the first post-intervention time-point. The effect/association of interest
in this command.

corr(string) Matrix for the correlation structure of the modelled time points, including the post-interention
time-point. If N pre-intervention time-points are specified, a two-dimensional N+1 by N+1 correlation
matrix is expected (with all diagonal cells being N and all other cells in the [0,1) range).

sd(string) Matrix for the standard deviation of the outcome in each time-point, including the post-intervention
time point. If N pre-intervention time-points are specified, a single dimension matrix with N+1 positive cells
is expected.

Optional

lvlsd(#) Standard deviation (real>0) for the level change in the post-intervention time point.
The default is 0, which implies a fixed level change across all units (as defined by lvlmn(#)).

clvl(#) Set confidence level. The default is 95% (alpha level of 5%). See level.

seed(#) Set initial value of random-number seed, for the simulations. See set seed.

moreon Set more on (default is off).

Example

1000 simulations, 50 general practice, 3 pre-intervention time-points, to detect a mean increase of 1 in agreggate quaility
scores post-intervention (with no variance across units).
First, the two matrices need to be defined. The correlation matrix is defined to model a modest correlation for
the practice scores at neighbouring time-points, which becomes weaker over time:

. matrix Cmat = (1, 0.5, 0.4, 0.3 \ 0.5, 1, 0.5, 0.4 \ 0.4, 0.5, 1, 0.5 \ 0.3, 0.4, 0.5, 1)

The standard deviation matrix is defined to model high variation, in relation to the level change we wish to measure:

. matrix Smat = (3, 3, 3, 3)

. itspower, sn(1000) nuts(50) lvlmn(1) prepoints(3) sd(Smat) corr(Cmat) lvlsd(0) seed(7)

Saved results

itspower saves the following in r():

Scalars

r(pow) Power to detect specified effect

r(lpow) Lower confidence interval for power estimate (default 95%)

r(upow) Upper confidence interval for power estimate (default 95%)

Author

Evangelos Kontopantelis, Faculty of Biology, Medicine and Health

University of Manchester, e.kontopantelis@manchester.ac.uk

Please cite as

Kontopantelis E. 2018.
itspower: Simulation based power calculations for linear interrupted time series (ITS) designs.

Other references

Kontopantelis E et al. Regression based quasi-experimental approach when randomisation is not an option:
interrupted time series analysis. The British Medical journal, 2015 June; 350 doi: https://doi.org/10.1136/bmj.h2750.

Also see

help for ipdpower