ONEWAYANOVA Statement

ONEWAYANOVA <options> ;

The ONEWAYANOVA statement performs power and sample size analyses for one-degree-of-freedom contrasts and the overall test in one-way analysis of variance.

Summary of Options

Table 70.12 summarizes categories of options available in the ONEWAYANOVA statement.

Table 70.12 Summary of Options in the ONEWAYANOVA Statement

Task

Options

Define analysis

TEST=

Specify analysis information

ALPHA=

 

CONTRAST=

 

SIDES=

 

NULLCONTRAST=

Specify effects

GROUPMEANS=

Specify variability

STDDEV=

Specify sample size and allocation

GROUPNS=

 

GROUPWEIGHTS=

 

NPERGROUP==

 

NTOTAL=

Specify power

POWER=

Control sample size rounding

NFRACTIONAL

Control ordering in output

OUTPUTORDER=

Table 70.13 summarizes the valid result parameters for different analyses in the ONEWAYANOVA statement.

Table 70.13 Summary of Result Parameters in the ONEWAYANOVA Statement

Analyses

Solve For

Syntax

TEST=CONTRAST

Power

POWER=.

 

Sample size

NTOTAL=.

   

NPERGROUP==.

TEST=OVERALL

Power

POWER=.

 

Sample size

NTOTAL=.

   

NPERGROUP==.

Dictionary of Options

ALPHA=number-list

specifies the level of significance of the statistical test. The default is 0.05, corresponding to the usual 0.05 100% = 5% level of significance. See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

CONTRAST= ( values ) < ( ...values ) >

specifies coefficients for single-degree-of-freedom hypothesis tests. You must provide a coefficient for every mean appearing in the GROUPMEANS= option. Specify multiple contrasts either with additional sets of coefficients or with additional CONTRAST= options. For example, you can specify two different contrasts of five means by using the following:

   CONTRAST = (1 -1 0 0 0) (1 0 -1 0 0)
GROUPMEANS=grouped-number-list
GMEANS=grouped-number-list

specifies the group means. This option is used to implicitly set the number of groups. See the section Specifying Value Lists in Analysis Statements for information about specifying the grouped-number-list.

GROUPNS=grouped-number-list
GNS=grouped-number-list

specifies the group sample sizes. The number of groups represented must be the same as with the GROUPMEANS= option. See the section Specifying Value Lists in Analysis Statements for information about specifying the grouped-number-list.

GROUPWEIGHTS=grouped-number-list
GWEIGHTS=grouped-number-list

specifies the sample size allocation weights for the groups. This option controls how the total sample size is divided between the groups. Each set of values across all groups represents relative allocation weights. Additionally, if the NFRACTIONAL option is not used, the total sample size is restricted to be equal to a multiple of the sum of the group weights (so that the resulting design has an integer sample size for each group while adhering exactly to the group allocation weights). The number of groups represented must be the same as with the GROUPMEANS= option. Values must be integers unless the NFRACTIONAL option is used. The default value is 1 for each group, amounting to a balanced design. See the section Specifying Value Lists in Analysis Statements for information about specifying the grouped-number-list.

NFRACTIONAL
NFRAC

enables fractional input and output for sample sizes. See the section Sample Size Adjustment Options for information about the ramifications of the presence (and absence) of the NFRACTIONAL option.

NPERGROUP=number-list
NPERG=number-list

specifies the common sample size per group or requests a solution for the common sample size per group with a missing value (NPERGROUP==.). Use of this option implicitly specifies a balanced design. See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

NTOTAL=number-list

specifies the sample size or requests a solution for the sample size with a missing value (NTOTAL=.). See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

NULLCONTRAST=number-list
NULLC=number-list

specifies the null value of the contrast. The default value is 0. This option can be used only with the TEST=CONTRAST analysis. See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

OUTPUTORDER=INTERNAL
OUTPUTORDER=REVERSE
OUTPUTORDER=SYNTAX

controls how the input and default analysis parameters are ordered in the output. OUTPUTORDER=INTERNAL (the default) arranges the parameters in the output according to the following order of their corresponding options:

The OUTPUTORDER=SYNTAX option arranges the parameters in the output in the same order in which their corresponding options are specified in the ONEWAYANOVA statement. The OUTPUTORDER=REVERSE option arranges the parameters in the output in the reverse of the order in which their corresponding options are specified in the ONEWAYANOVA statement.

POWER=number-list

specifies the desired power of the test or requests a solution for the power with a missing value (POWER=.). The power is expressed as a probability, a number between 0 and 1, rather than as a percentage. See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

SIDES=keyword-list

specifies the number of sides (or tails) and the direction of the statistical test. See the section Specifying Value Lists in Analysis Statements for information about specifying the keyword-list. Valid keywords are as follows:

1

one-sided with alternative hypothesis in same direction as effect

2

two-sided

U

upper one-sided with alternative greater than null value

L

lower one-sided with alternative less than null value

This option can be used only with the TEST=CONTRAST analysis. The default value is 2.

STDDEV=number-list
STD=number-list

specifies the error standard deviation. See the section Specifying Value Lists in Analysis Statements for information about specifying the number-list.

TEST=CONTRAST
TEST=OVERALL

specifies the statistical analysis. TEST=CONTRAST specifies a one-degree-of-freedom test of a contrast of means. The test is the usual test for the two-sided case and the usual test for the one-sided case. TEST=OVERALL specifies the overall test of equality of all means. The default is TEST=CONTRAST if the CONTRAST= option is used, and TEST=OVERALL otherwise.

Restrictions on Option Combinations

To specify the sample size and allocation, choose one of the following parameterizations:

  • sample size per group in a balanced design (by using the NPERGROUP== option)

  • total sample size and allocation weights (by using the NTOTAL= and GROUPWEIGHTS= options)

  • individual group sample sizes (by using the GROUPNS= option)

Option Groups for Common Analyses

This section summarizes the syntax for the common analyses supported in the ONEWAYANOVA statement.

One-Degree-of-Freedom Contrast

You can use the NPERGROUP== option in a balanced design, as in the following statements. Default values for the SIDES=, NULLCONTRAST=, and ALPHA= options specify a two-sided test for a contrast value of 0 with a significance level of 0.05.

proc power;
   onewayanova test=contrast
      contrast = (1 0 -1)
      groupmeans = 3 | 7 | 8
      stddev = 4
      npergroup = 50
      power = .;
run;

You can also specify an unbalanced design with the NTOTAL= and GROUPWEIGHTS= options:

proc power;
   onewayanova test=contrast
      contrast = (1 0 -1)
      groupmeans = 3 | 7 | 8
      stddev = 4
      groupweights = (1 2 2)
      ntotal = .
      power = 0.9;
run;

Another way to specify the sample sizes is with the GROUPNS= option:

proc power;
   onewayanova test=contrast
      contrast = (1 0 -1)
      groupmeans = 3 | 7 | 8
      stddev = 4
      groupns = (20 40 40)
      power = .;
run;

Overall F Test

The following statements demonstrate a power computation for the overall F test in a one-way ANOVA. The default of ALPHA=0.05 specifies a significance level of 0.05.

proc power;
   onewayanova test=overall
      groupmeans = 3 | 7 | 8
      stddev = 4
      npergroup = 50
      power = .;
run;