Calculates the power (probability of detection) for terms in an analysis of variance (R.W. Payne).
|Prints the power (
||Treatment term to be assessed in the analysis|
||Treatment structure of the design; determined automatically from an
||Block structure of the design; determined automatically from an
||Limit on the number of factors in treatment terms; default 3|
||Significance level at which the response is required to be detected (assuming a one-sided test); default 0.05|
||Type of test to be made (
||X-variate defining a contrast to be detected|
||Type of contrast (
||Size of the difference or contrast between the effects of
||Anticipated residual mean square corresponding to
||Power (i.e. probability of detection) for
When assessing an experimental design, it can be useful to know how likely a treatment response of a specified size may be detected. This probability of detection, known as the power of the design with respect to the response of interest, helps to determine whether the experiment is sufficiently large or accurate to achieve its purpose.
The treatment term to test is specified using the
TERM option of
APOWER, and the difference that you want to detect between its effects is given by the
RESPONSE parameter. As an alternative to detecting a difference between treatment effects, you can ask to detect a contrast. However, here the treatment term must be a main effect (that is,
TERM must involve just one factor). The
XCONTRASTS option then species a variate containing the coefficients defining the contrast, and the
CONTRASTTYPE option indicates whether this is a regression contrast (as specified by the
REG function) or a comparison (as specified by
PROBABILITY option specifies the significance level that you will be using in the analysis to detect the treatment difference or contrast; the default is 0.05, i.e. 5%. By default,
APOWER assumes that a one-sided t-test is to be used, but you can set option
TMETHOD=twosided to take a two-sided t-test instead.
Other settings of
TMETHOD enable you to test for equivalence or for non-inferiority. With equivalence (
RESPONSE defines a threshold below which the treatments can be assumed to be equivalent. If the treatments have effects e1 and e2, the null hypothesis that the treatments are not equivalent is that either
(e1 – e2) ≤ –
(e1 – e2) ≥
with the alternative hypothesis that they are equivalent, i.e.
RESPONSE < (e1 – e2) <
(For further details see the Method information for procedure
ASAMPLESIZE.) With non-inferiority (
RESPONSE again specifies the threshold for the effect of one treatment to be superior to another. So, for example, to demonstrate non-inferiority of treatment 1 compared to treatment 2, the null hypothesis becomes
(e1 – e2) ≥ –
which represents a simple one-sided t-test.
You can also set
TMETHOD=fratio, to assess the power of the F test in the analysis of variance table to detect a pattern of effects for
TERM. You can specify the pattern by setting
RESPONSE to a table containing the anticipated effects or means. Alternatively, you can set it to a y-variate containing, in each unit, the value of the effect or mean for the treatment (or treatment combination) to be applied to that unit of the design.
To determine the power, you need to define the design and specify the anticipated residual mean square for the stratum where the treatment term is estimated. This is most easily obtained by taking the analysis of a design with similar units and the same block and treatment structures as those that are to be used in the new design. To do this, you should analyse the earlier set of data with the
ANOVA directive in the usual way. First define the strata (or error terms) for the design using the
BLOCKSTRUCTURE directive, and the treatment model to be fitted using the
TREATMENTSTRUCTURE directive. Then analyse the y-variate using the
ANOVA directive. Provided you do not give any other
ANOVA commands in the interim,
APOWER will pick up the information automatically from the save information held within Genstat about the most recent
ANOVA analysis. Alternatively, you can save the information explicitly in an
ANOVA save structure, using the
SAVE parameter of
ANOVA, and then use this same save structure as the setting of the
SAVE option of
If you do not have a suitable earlier set of data, you should set up the design factors to contain the values required to define the units of the design. Then use the
TREATMENTSTRUCTURE options of
APOWER to define the strata and the treatment model, and the
RMS option to specify the anticipated residual mean square for the stratum where
TERM is estimated. There is also the compromise possibility that you can take the information about the design, the strata and treatment model from an
ANOVA save structure (generated for example by the analysis of an artificial data set), but use the
RMS parameter to specify a different residual mean square from the one in the analysis in the save structure. The treatment terms to be included are controlled by the
FACTORIAL option; this sets a limit (by default 3) on the number of factors in a treatment term: terms containing more than that number are deleted.
POWER parameter can save the power. This is printed by default, but you can set option
PRINT=* to stop this.
The standard error of difference between two treatment effects is
√( s2 × 2 / (r × e))
where s2 is the residual mean square of the stratum where the treatment term is estimated, e is the efficiency factor, and r is the replication of each effect. For a regression contrast the standard error is
√( s2 × 2 / (r × sdiv × e))
where sdiv is the sum of squares of the
XCONTRASTS variate, and for a comparison contrast the standard error is
√( s2 × sdiv / (r × e))
APOWER assumes that the treatment effects have equal replication. Unequal replication can be studied by defining a comparison between the effects. For example, to allow for a control level with two replicates, you could assume that the first two levels are for the control, and then study comparisons between their mean and the other levels.
CAPTION 'APOWER example',!t('Split plot design',\ '(Yates,F: The Design and Analysis of Factorial Experiments,',\ 'Commonwealth Bureau of Soils, Tech. Comm. 35, p.74)');\ STYLE=meta,plain FACTOR [NVALUES=72; LEVELS=6] Block & [LEVELS=3] Wplot & [LEVELS=4] Subplot GENERATE Block,Wplot,Subplot FACTOR [NVAL=72; LABELS=!T('0 cwt','0.2 cwt','0.4 cwt','0.6 cwt')] Nitrogen & [NVAL=72; LABELS=!T(Victory,'Golden rain',Marvellous)] Variety READ [SERIAL=yes] Nitrogen,Variety 4 3 2 1 1 2 4 3 1 2 3 4 3 1 2 4 4 1 2 3 2 1 3 4 2 3 4 1 4 2 3 1 1 4 2 3 3 4 1 2 1 3 4 2 2 3 4 1 4 1 3 2 3 4 1 2 3 4 2 1 3 1 4 2 4 3 1 2 1 2 3 4 : 3 3 3 3 1 1 1 1 2 2 2 2 3 3 3 3 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 1 1 1 1 3 3 3 3 2 2 2 2 1 1 1 1 2 2 2 2 1 1 1 1 3 3 3 3 1 1 1 1 2 2 2 2 3 3 3 3 : VARIATE [NVALUES=72] Yield READ Yield 156 118 140 105 111 130 174 157 117 114 161 141 104 70 89 117 122 74 89 81 103 64 132 133 108 126 149 70 144 124 121 96 61 100 91 97 109 99 63 70 80 94 126 82 90 100 116 62 96 60 89 102 112 86 68 64 132 124 129 89 118 53 113 74 104 86 89 82 97 99 119 121 : MATRIX [ROWS=!t('Victory & Golden rain versus Marvellous'); COLUMNS=3;\ VALUES=1,1,-2] Vcomp VARIATE [VALUES=0,0.2...0.6] Nreg BLOCKSTRUCTURE Block/Wplot/Subplot TREATMENTSTRUCTURE COMPARISON(Variety;1;Vcomp) * POL(Nitrogen;1;Nreg) ANOVA [PRINT=aov,contrasts,means; FPROBABILITY=yes] Yield; SAVE=savesp APOWER [PRINT=power; TERM=Variety] 25; RMS=600 APOWER [PRINT=power; TERM=Nitrogen] 15; RMS=200 APOWER [PRINT=power; TERM=Variety; XCONTRASTS=!(#Vcomp);\ CONTRASTTYPE=comparison] 30 APOWER [PRINT=power; TERM=Nitrogen; XCONTRASTS=Nreg;\ CONTRASTTYPE=regression] 20