*! version 0.1.0 13jul2012

help metapowplot also see: metasim, metapow

Title

metapowplot -- Produces power plots based on meta-analysis

Syntax

metapowplot varlist , start(#) stop(#) step(#) nit(#) type(string) pow(numlist) [options]

Main
start(#) minimum number of subjects in group 1 (see below)

stop(#) maximum number of subjects in group 1 (see below)

step(#) step size between start and stop sample sizes

type(string) type of study being simulated

nit(#) number of simulations the power calculation is based on

pow(numlist) cut-off value for determining power

Optional
measure(string) outcome measure used in meta-analysis

inference(string) inference statistic on which power is based

p(#) event rate or probability of being diseased dependent on (type)

r(#) ratio of patients in two groups; treatment and control or diseased and healthy

studies(#) number of new studies to be simulated

model(string) meta-analysis model used on pre-existing data

npow(numlist) additional inference statistic on which power is based

ci(#) width of confidence interval for power estimate (default=95%)

dist(string) distribution of effect sizes used to simulate the new study from

ind calculates power for new study on its own

nip(#) number of integration points used for quadrature in bivariate model

sos(string) inference option for sensitivity and specificity to be used with ciwidth or lci

graph(string) type of graph to be plotted

noci prevents confidence intervals from being displayed on the graph

regraph allows the user to re-graph the power curve using alternative graph options

level(cilevel) specifies the confidence level for the study confidence intervals

Description

metapowplot estimates the power of an updated meta-analysis including a new study and plots each value against
a range of sample sizes. The program calls on the program metapow to generate the power
estimates. The user needs to input a minimum and a maximum sample size for which they want to calculate a power estimate. The
power estimates are stored with their confidence intervals in a file called temppow3 within the working directory.

Options

Main

start(integer) is the smallest total sample size for a new study that the user wishes to calculate a power value for.

stop(integer) is the largest total sample size for a new study that the user wishes to calculate the power value for.

step(integer) is the step size to be used within the range of total sample sizes specified by start and stop.
A step size of 10 between the range of 10 to 30 would mean that the power would be estimated for sample sizes of 10, 20 and 30.

type(clinical/diagnostic) specifies the type of new study that the user would like to simulate; either a 2-arm clinical trial or a diagnostic test accuracy study.

nit(integer) is the number of simulations that are run on which the estimated poweris based. The larger the number specified the more accurate
the estimate will be, but the longer the analysis will take.

pow(numlist) specifies the value used as a cut-off in determining the power. One or two values can be inputted.
The value/s represents different things depending on the option chosen for inference.

Optional

measure(or/rr/rd/nostandard/dor/ss) specifies the outcome measure used in the meta-analysis to pool the results. The odds ratio (or), relative risk (rr),
risk difference (rd) and unstandardised mean difference (nostandard) can only be used when simulating a new clinical study. The diagnostic odds ratio (dor)
and sensitivity and specificity (ss) can only be used when simulating a new diagnostic accuracy study. The default for a clinical type study with 4 variables entered
into the varlist is relative risk (rr, the default for a clinical type study with 6 variables entered
into the varlist is unstandardised mean difference (nostandard and the default for a diagnostic type study is sensitivity and specificity (ss).

inference(ciwidth/pvalue/lci/uci) defines the approach to inference used to calculate power. The default is the confidence
interval width (ciwidth). This counts the number of times that the confidence interval width of the estimate/s from the updated meta-analysis
(i.e. with the simulated study(ies) included)
is less than the specified value/s. This option can be used regardless of the measure of accuracy. Two other approaches to inference available are
lci and uci. These will count the number of times that the lower or upper confidence interval is higher or lower than a given value respectively. The lci
option can be used regardless of the measure of accuracy. However, the uci option is currently only available when working with clinical trial data
and not diagnostic data. A final option only available when using clinical trial data is the pvalue. This counts the number of times that a p-value
is significant to a specified level. When using sensitivity and specificity two values may be inputted into pow for ciwidth and lci.
This will instruct the program to count the number of times that the confidence interval widths for both sensitivity and specificity are less than
their respective specified values. These must be given in the order sensitivity and specificity to be calculated correctly. In order to use the
ciwidth or lci options for just sensitivity or just specificity the sos option should be used in addition to this option.

p(real) if simulating a new clinical study then this is the estimated event rate in the control group in the new study. When simulating a new diagnostic study
this is the estimated probability of being diseased given a positive result in the new study. When this option is not specified by the user, the program will
calculate this value by averaging the probabilities across the studies included in the dataset memory. Note that p is only relevant in the diagnostic framework
when using the diagnostic odds ratio ( dor) as the option in measure.

r(real) is the ratio of patients in the control group to the treatment group when simulating a new clinical study. When simulating a new diagnostic accuracy
study this is the ratio of diseased to healthy people if using sensitivity and specificity and the ratio of positive to negative results if using the DOR
(default 1).

studies(integer) specifies the number of new studies to be simulated (default 1).
When more than one are specified they are all assumed to have the same sample size.

model(fixed/fixedi/random/randomi/bivariate) defines the type of model used to meta-analyse the pre-existing data. The default is the fixed effect
Mantel-Haenszel method (fixed) unless the outcome measure is the nonstandardised mean difference in which case the default is the inverse variance method (fixedi).
The (fixedi) option specifies a fixed effect model using the inverse variance method. The (random)
option uses the random effect DerSimonian & Laird method, taking the estimate for heterogeneity from the Mantel-Haenszel method. The (randomi) option
specifies a random effects model using the method of DerSimonian and Laird, with the estimate of heterogeneity being taken from the inverse-variance
fixed-effect model. All of the above options call on the metan command within the program. The final option is the bivariate random effects
model (bivariate). This method calls on a combination of the metandi and midas commands. It may only be specified
when simulating a new diagnostic accuracy study.

npow(numlist) recalculates the power using a newly specified value for the same inference without having to re-run the whole program. Instead, it
uses the data that is stored in temppow2 and allows alternative approaches to inference to be explored. This is particularly valuable when the required simulation time is lengthy.

ci(real) specifies the width of the confidence interval for the corresponding power estimate (default 95%).

dist(normal/t) specifies the distribution of effect sizes used to sample a value from in order to simulate a new study(ies).
The default for the (random) and (randomi) is a predictive distribution based on the t-distribution (t) allowing
for heterogeneity between studies (and the uncertainty in the heterogeneity).
The default for all other models is the (normal) distribution based on the mean and variance entered in es and var.

ind instructs the program to calculate the power for the newly simulated study on its own in addition to the newly updated meta-analysis.

nip(integer) specifies the number of integration points used for quadrature when the bivariate model is selected. Higher values should result in greater accuracy but typically at
the expense of longer execution times (see Rabe-Hesketh, Skrondal, and Pickles 2005, app. B).

sos(sens/spec) used in addition to the inference option this specifies whether inferences are focused on sensitivity or specificity when using ciwidth
or lci as inference options. The default option is to use sensitivity. If sos is not specified then the inferences are based on both the sensitivity and specificity and two values should be entered for pow.

graph(lowess/connected/overlay) allows the user to choose the type of line used to connect the specific estimates of power at the specified sample sizes.
The default option is a connected graph which plots each point and connects them with a line. The other options are a lowess plot, which plots a smoothed
line to the specific points, and an overlay plot, which plots both the points and the lowess curve. Since power is estimated through simulation, there is sampling
error in each estimate which will decrease with the number of simulations specified (but also increase evaluation time). Thus smoothing may be desirable if several different
but inaccurate estimates are considered. The lowess line should be similar to the connected option for larger simulations.

noci prevents the program from plotting confidence intervals (indicating the sampling error in the estimation of power at specified sample sizes) on the graph.

regraph allows the user to re-graph the power curves with alternative graph options without having to run the simulations for the specified range of sample sizes again.

level specifies the confidence level, as a percentage, for the individual study and pooled confidence intervals. This is the level that is given in the
metan, metandi and midas commands when called on to meta-analyses the current data set. The default is level(95).

Examples

Fixed effect Mantel-Haenszel method meta-analysis of clinical trial data using the odds ratio outcome for sample sizes ranging from 10 to 1010 in both the control group and the
treatment group of the new study (in increments of 100) and using a p-value of 0.05 for the hypothesis test that the pooled treatment effect is different from 0
to calculate power through 100 iterations for each sample size (i.e. power is based on the proportion os the simulations in which the p-value for the treatment effect
being different from 0 is less than 0.05). Note that the program will plot the power curve against the total sample size for the treatment and control groups combined.

. metapowplot e_trt ne_trt e_ctrl ne_ctrl, nit(100) start(10) step(100) stop(1010) measure(or) model(fixed) type(clinical) pow(0.05) inference(pvalue)

Bivariate random effects model for combining diagnostic test accuracy data is used. Both sensitivity and specificity are considered for inferences purposes
for sample sizes ranging from 100 to 5000 (in steps of 100) in both the diseased group and the healthy group of the new study and using confidence interval
widths of 0.2 and 0.1 for sensitivity and specificity respectively to calculate power through 1000 iterations (i.e. the width of each confidence interval
has to be less than these values for the meta-analysis to be considered "significant").

. metapowplot TP FP FN TN, nit(1000) start(100) step(100) stop(5000) measure(ss) model(bivariate) type(diagnostic) pow(0.2 0.1) inference(ciwidth)

Unstandardised mean difference comparing exercise to no treatment in patients with chronic back pain (Ferreira et al. 2012). We investigate the power of the updated meta-analysis when comparing the lower
confidence interval to a reduction in pain of 20 points. We vary the sample size of each arm of the new study from 50 to 550 patients in steps of 100.

. use http://fmwww.bc.edu/repec/bocode/m/metapow_eg1

. metapowplot nrxpain rxmeanpain rxsdpain ncomppain compmeanpain compsdpain, nit(100) type(clinical) measure(nostandard) model(random) pow(-20) inference(lci) start(50) stop(550) step(100) graph(lowess)

(click to run)

Authors

Michael J. Crowther, University of Leicester, United Kingdom. Email: michael.crowther@le.ac.uk.

Sally R. Hinchliffe, University of Leicester, United Kingdom. Email: srh20@le.ac.uk.

Alison Donald, University of Leicester, United Kingdom.

Alex J. Sutton, University of Leicester, United Kingdom. Email: ajs22@le.ac.uk.

References

Hinchliffe S, Crowther MJ, Phillips RS, Sutton AJ. Using meta-analysis to inform the design of subsequent studies of diagnostic test accuracy (Submitted)

Ferreira ML, Herbert RD, Crowther MJ, Verhagen A, Sutton AJ. When is another clinical trial justified? (Submitted)

Sutton AJ, Cooper NJ, Jones DR, Lambert PC, Thompson JR, Abrams KR. Evidence-based sample size calculations based upon meta-analysis. Statistics in Medicine 2007; 26:2479-2500.

Also see

Online: metasim, metapow