{smcl}
{* *!version 0.1.0 13jul2012}{...}
{hline}
{cmd:help metapow}{right:also see: {helpb metasim}, {helpb metapowplot}}
{hline}
{title:Title}
{p2colset 5 16 20 2}{...}
{p2col :{cmd:metapow} {hline 2}}Tool to estimate power through simulation of a 2-arm clinical trial(s) or diagnostic test accuracy study(ies) to change
inferences when updating an existing meta-analysis including the new study(ies){p_end}
{p2colreset}{...}
{title:Syntax}
{phang2}
{cmd: metapow} {it:varlist} {cmd:,} {opt n:(#)} {opt nit:(#)} {opt type:(string)} {opt pow:(numlist)} [{it:options}]
{synoptset 18 tabbed}{...}
{synopthdr}
{synoptline}
{syntab :Main}
{synopt:{opt n(#)}} number of patients in group 1 of the new study (see below) {p_end}
{synopt:{opt nit(#)}} number of simulations the power calculation is based on {p_end}
{synopt:{opt ty:pe(string)}} type of study being simulated {p_end}
{synopt:{opt pow(numlist)}} cut-off value for determining power {p_end}
{syntab :Optional}
{synopt:{opt meas:ure(string)}} outcome measure used in meta-analysis {p_end}
{synopt:{opt inf:erence(string)}} inference statistic on which power is based {p_end}
{synopt:{opt p(#)}} event rate or probability of being diseased dependent on {it:type} {p_end}
{synopt:{opt r(#)}} ratio of patients in two groups; treatment and control or diseased and healthy {p_end}
{synopt:{opt st:udies(#)}} number of new studies to be simulated {p_end}
{synopt:{opt mod:el(string)}} meta-analysis model used on pre-existing data {p_end}
{synopt:{opt npow(numlist)}} additional inference statistic on which power is based {p_end}
{synopt:{opt ci(#)}} width of confidence interval for power estimate (default=95%) {p_end}
{synopt:{opt dist(string)}} distribution of effect sizes used to simulate the new study from {p_end}
{synopt:{opt ind}} calculates power for new study on its own {p_end}
{synopt:{opt nip(#)}} number of integration points used for quadrature in bivariate model {p_end}
{synopt:{opt sos(string)}} inference option for sensitivity and specificity to be used with {it:ciwidth} or {it:lci} {p_end}
{synopt:{opt level(cilevel)}} specifies the confidence level for the study confidence intervals {p_end}
{synoptline}
{p2colreset}{...}
{title:Description}
{pstd}{cmd:metapow} implements an approach to estimating the power of a newly simulated study(ies), generated using the program metasim. It can also estimate
the power of the updated meta-analysis including the new study. The power estimates are then stored in a file called temppow2 within the working directory.
{title:Options}
{dlgtab:Main}
{phang}
{opt n(integer)} relates to the number of patients in the new study. If simulating a new clinical trial, then this specifies the number of patients
in the control group. If simulating a new diagnostic accuracy study then {opt n} is the number of diseased patients when using sensitivity and
specificity as the outcome measure of accuracy, or the number of positive test results if using the diagnostic odds ratio (DOR). {p_end}
{phang}
{opt 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. {p_end}
{phang}
{opt 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. {p_end}
{phang}
{opt 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 {it:inference}. {p_end}
{dlgtab:Optional}
{phang}
{opt measure(or/rr/rd/nostandard/dor/ss)} specifies the outcome measure used in the meta-analysis to pool the results. The odds ratio ({it:or}), relative risk ({it:rr}),
risk difference ({it:rd}) and unstandardised mean difference ({it:nostandard}) can only be used when simulating a new clinical study. The diagnostic odds ratio ({it:dor})
and sensitivity and specificity ({it:ss}) can only be used when simulating a new diagnostic accuracy study. The default for a clinical {opt type} study with 4 variables entered
into the {it: varlist} is relative risk ({it:rr}, the default for a clinical {opt type} study with 6 variables entered into the {it: varlist} is unstandardised mean difference
({it:nostandard} and the default for a diagnostic {opt type} study is sensitivity and specificity ({it:ss}).{p_end}
{phang}
{opt inference(ciwidth/pvalue/lci/uci)} defines the approach to inference used to calculate power. The default is the confidence
interval width ({it: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
{it:lci} and {it: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 {it:lci}
option can be used regardless of the measure of accuracy. However, the {it: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 {it: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 {it:pow} for {it:ciwidth} and {it: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
{it:ciwidth} or {it:lci} options for just sensitivity or just specificity the {it:sos} option should be used in addition to this option. {p_end}
{phang}
{opt 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 {opt p} is only relevant in the diagnostic framework
when using the diagnostic odds ratio ({it: dor}) as the option in {opt measure}. {p_end}
{phang}
{opt 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). {p_end}
{phang}
{opt 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. {p_end}
{phang}
{opt 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 ({it:fixed}) unless the outcome measure is the nonstandardised mean difference in which case the default is the inverse variance method ({it:fixedi}).
The ({it:fixedi}) option specifies a fixed effect model using the inverse variance method. The ({it:random})
option uses the random effect DerSimonian & Laird method, taking the estimate for heterogeneity from the Mantel-Haenszel method. The ({it: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 {helpb metan} command within the program. The final option is the bivariate random effects
model ({it:bivariate}). This method calls on a combination of the {helpb metandi} and {helpb midas} commands. It may only be specified
when simulating a new diagnostic accuracy study. {p_end}
{phang}
{opt npow(numlist)} recalculates the power using a newly specified value for the same {it: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. {p_end}
{phang}
{opt ci(real)} specifies the width of the confidence interval for the corresponding power estimate (default 95%). {p_end}
{phang}
{opt 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 ({it:random}) and ({it:randomi}) is a predictive distribution based on the t-distribution ({it:t}) allowing
for heterogeneity between studies (and the uncertainty in the heterogeneity).
The default for all other models is the ({it:normal}) distribution based on the mean and variance entered in {opt es} and {opt var}. {p_end}
{phang}
{opt ind} instructs the program to calculate the power for the newly simulated study on its own in addition to the newly updated meta-analysis. {p_end}
{phang}
{opt 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 {help metandi##rhsp:Rabe-Hesketh, Skrondal, and Pickles 2005}, app. B). {p_end}
{phang}
{opt sos(sens/spec)} used in addition to the {it:inference} option this specifies whether inferences are focused on sensitivity or specificity when using {it:ciwidth}
or {it:lci} as inference options. The default option is to use sensitivity. If {opt sos} is not specified then the inferences are based on both the sensitivity and specificity and two values should be entered for {opt pow}. {p_end}
{phang}
{opt 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
{helpb metan}, {helpb metandi} and {helpb midas} commands when called on to meta-analyses the current data set. The default is level(95). {p_end}
{title:Examples}
{pstd}Fixed effect meta-analysis of clinical trials using the odds ratio, assuming 100 patients in both the control group and the treatment group of the new study
and using a confidence interval width cut-off of 2 on the odds ratio scale to calculate power through 100 iterations (i.e. power is based on the proportion of the simulations
in which the confidence interval for the pooled OR is less than 2).{p_end}
{phang}{cmd:. metapow e_trt ne_trt e_ctrl ne_ctrl, model(fixed) measure(or) n(100) nit(100) type(clinical) pow(2) inference(ciwidth)}{p_end}
{pstd}Random effects meta-analysis of clinical trials using the risk difference, assuming 50 patients in both the control group and the treatment group of the new study
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 1000 iterations (i.e. power is based on the proportion
of simulations in which the p-value for the treatment effect being different from 0 is less then 0.05).{p_end}
{phang}{cmd:. metapow e_trt ne_trt e_ctrl ne_ctrl, model(random) measure(rd) n(50) nit(1000) type(clinical) pow(0.05) inference(pvalue)}{p_end}
{pstd}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 choose a sample size of 250 patients in each arm. We then use {cmd:extfunnel} to intuitively explain the simulated individual
studies on the extended funnel plot (Crowther et al. 2012).{p_end}
{phang}{cmd:. use http://fmwww.bc.edu/repec/bocode/m/metapow_eg1}{p_end}
{phang}{cmd:. metapow nrxpain rxmeanpain rxsdpain ncomppain compmeanpain compsdpain, n(250) nit(1000) type(clinical) measure(nostandard) model(randomi) pow(-20) inference(lci)}{p_end}
{phang}{cmd:. merge 1:1 _n using "`c(pwd)'\temppow2.dta", nogen noreport}{p_end}
{phang}{cmd:. extfunnel paindiff painse, randomi cpoints(500) null(-20) name(painfunnel20, replace) ///}{p_end}
{phang}{cmd:> nometan title("PAIN: smallest worthwhile effect = -20", size(medium)) xsc(titlegap(medium)) ///}{p_end}
{phang}{cmd:> xrange(-100 75) xlabel(-100(25)75)yrange(0 15) scale(1.2) legend(order(1 "Unclear if worthwhile" 2 ///}{p_end}
{phang}{cmd:> "Clearly not worthwhile" 3 "Clearly worthwhile" 4 "Smallest worthwhile effect" 5 "Current pooled estimate" ///}{p_end}
{phang}{cmd:> 6 "Current point estimates" 7 "Simulated studies") size(small)) scheme(color) ///}{p_end}
{phang}{cmd:> addplot(scatter indse_es indes, msize(tiny) msym(T) mcol(black))}{p_end}
{phang}{it:({stata "metapow_eg1":click to run})}{p_end}
{pstd}Random effect meta-analysis of diagnostic test accuracy studies using sensitivity and specificity to base inferences on, assuming 1000 patients in the diseased group and 250 patients in the healthy
group of the new study and using 95% confidence interval widths of 0.2 and 0.1 for sensitivity and specificity respectively to calculate power through 1000 iterations
(i.e. power is estimated as the proportion of simulations in which the updated meta-analysis estimates sensitivity and specificity with 95% confidence interval
widths less than 0.2 and 0.1 respectively).{p_end}
{phang}{cmd:. metapow TP FP FN TN, model(random) measure(ss) n(1000) nit(1000) type(diagnostic) pow(0.2 0.1) inference(ciwidth) r(0.25)}{p_end}
{pstd}Bivariate random effect meta-analysis of diagnostic studies using sensitivity and specificity, assuming 80 patients in both the diseased group and the healthy group of the new study
and using a lower confidence interval value of 0.25 for sensitivity to calculate power through 50 iterations (i.e. power is estimated as the proportion of simulations in which the updated meta-analysis
estimates the lower confidence interval for sensitivity to be less than 0.25).{p_end}
{phang}{cmd:. metapow TP FP FN TN, model(bivariate) measure(ss) n(80) nit(50) type(bivariate) pow(0.25) inference(lci) sos(sens)}{p_end}
{title:Authors}
{pstd}Michael J. Crowther, University of Leicester, United Kingdom. Email: {browse "mailto:michael.crowther@le.ac.uk":michael.crowther@le.ac.uk}.{p_end}
{pstd}Sally R. Hinchliffe, University of Leicester, United Kingdom. Email: {browse "mailto:srh20@le.ac.uk":srh20@le.ac.uk}.{p_end}
{pstd}Alison Donald, University of Leicester, United Kingdom.
{pstd}Alex J. Sutton, University of Leicester, United Kingdom. Email: {browse "mailto:ajs22@le.ac.uk":ajs22@le.ac.uk}.{p_end}
{title:References}
{phang}Crowther MJ, Langan D, Sutton AJ. Graphical augmentations to the funnel plot to assess the impact of a new study on an existing meta-analysis. {it: The Stata Journal} 2012; (In Press).{p_end}
{phang}Hinchliffe S, Crowther MJ, Phillips RS, Sutton AJ. Using meta-analysis to inform the design of subsequent studies of diagnostic test accuracy (Submitted) {p_end}
{phang}Ferreira ML, Herbert RD, Crowther MJ, Verhagen A, Sutton AJ. When is another clinical trial justified? (Submitted){p_end}
{phang}Sutton AJ, Cooper NJ, Jones DR, Lambert PC, Thompson JR, Abrams KR. Evidence-based sample size calculations based upon meta-analysis. {it:Statistics in Medicine} 2007; 26:2479-2500.{p_end}
{title:Also see}
{psee}
Online: {helpb metasim}, {helpb metapowplot}
{p_end}