The FREQ Procedure

Risks and Risk Differences

The RISKDIFF option in the TABLES statement provides estimates of risks (binomial proportions) and risk differences for 2 times 2 tables. This analysis might be appropriate when comparing the proportion of some characteristic for two groups, where row 1 and row 2 correspond to the two groups, and the columns correspond to two possible characteristics or outcomes. For example, the row variable might be a treatment or dose, and the column variable might be the response. For more information, see Collett (1991); Fleiss, Levin, and Paik (2003); Stokes, Davis, and Koch (2012).

Let the frequencies of the 2 times 2 table be represented as follows:

Column 1 Column 2 Total
Row 1 n 11 n 12 n Subscript 1 dot
Row 2 n 21 n 22 n Subscript 2 dot
Total n Subscript dot 1 n Subscript dot 2 n

By default when you specify the RISKDIFF option, PROC FREQ provides estimates of the row 1 risk (proportion), the row 2 risk, the overall risk, and the risk difference for column 1 and for column 2 of the 2 times 2 table. The risk difference is defined as the row 1 risk minus the row 2 risk. The risks are binomial proportions of their rows (row 1, row 2, or overall), and the computation of their standard errors and Wald confidence limits follow the binomial proportion computations, which are described in the section Binomial Proportion.

The column 1 risk for row 1 is the proportion of row 1 observations classified in column 1,

ModifyingAbove p With caret Subscript 1 Baseline equals n 11 slash n Subscript 1 dot Baseline

which estimates the conditional probability of the column 1 response, given the first level of the row variable. The column 1 risk for row 2 is the proportion of row 2 observations classified in column 1,

ModifyingAbove p With caret Subscript 2 Baseline equals n 21 slash n Subscript 2 dot Baseline

The overall column 1 risk is the proportion of all observations classified in column 1,

ModifyingAbove p With caret equals n Subscript dot 1 Baseline slash n

The column 1 risk difference compares the risks for the two rows, and it is computed as the column 1 risk for row 1 minus the column 1 risk for row 2,

ModifyingAbove d With caret equals ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2

The standard error of the column 1 risk for row i is computed as

normal s normal e left-parenthesis ModifyingAbove p With caret Subscript i Baseline right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript i Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript i Baseline right-parenthesis slash n Subscript i dot Baseline EndRoot

The standard error of the overall column 1 risk is computed as

normal s normal e left-parenthesis ModifyingAbove p With caret right-parenthesis equals StartRoot ModifyingAbove p With caret left-parenthesis 1 minus ModifyingAbove p With caret right-parenthesis slash n EndRoot

Where the two rows represent independent binomial samples, the standard error of the column 1 risk difference is computed as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript 1 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis slash n Subscript 1 dot Baseline plus ModifyingAbove p With caret Subscript 2 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis slash n Subscript 2 dot Baseline EndRoot

The computations are similar for the column 2 risks and risk difference.

Confidence Limits

By default, the RISKDIFF option provides Wald asymptotic confidence limits for the risks (row 1, row 2, and overall) and the risk difference. By default, the RISKDIFF option also provides exact (Clopper-Pearson) confidence limits for the risks. You can suppress the display of this information by specifying the NORISKS riskdiff-option. You can specify riskdiff-options to request tests and other types of confidence limits for the risk difference. For more information, see the sections Confidence Limits for the Risk Difference and Risk Difference Tests.

The risks are equivalent to the binomial proportions of their corresponding rows. This section describes the Wald confidence limits that are provided by default when you specify the RISKDIFF option. The BINOMIAL option provides additional confidence limit types and tests for risks (binomial proportions). For more information, see the sections Binomial Confidence Limits and Binomial Tests.

The Wald confidence limits are based on the normal approximation to the binomial distribution. PROC FREQ computes the Wald confidence limits for the risks and risk differences as

normal upper E normal s normal t plus-or-minus left-parenthesis z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis normal upper E normal s normal t right-parenthesis right-parenthesis

where Est is the estimate, z Subscript alpha slash 2 is the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesisth percentile of the standard normal distribution, and normal s normal e left-parenthesis normal upper E normal s normal t right-parenthesis is the standard error of the estimate. The confidence level alpha is determined by the value of the ALPHA= option; by default, ALPHA=0.05, which produces 95% confidence limits.

If you specify the CORRECT riskdiff-option, PROC FREQ includes continuity corrections in the Wald confidence limits for the risks and risk differences. The purpose of a continuity correction is to adjust for the difference between the normal approximation and the binomial distribution, which is discrete. See Fleiss, Levin, and Paik (2003) for more information. The continuity-corrected Wald confidence limits are computed as

normal upper E normal s normal t plus-or-minus left-parenthesis z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis normal upper E normal s normal t right-parenthesis plus c right-parenthesis

where c is the continuity correction. For the row 1 risk, c equals left-parenthesis 1 slash 2 n Subscript 1 dot Baseline right-parenthesis; for the row 2 risk, c equals left-parenthesis 1 slash 2 n Subscript 2 dot Baseline right-parenthesis; for the overall risk, c equals left-parenthesis 1 slash 2 n right-parenthesis; and for the risk difference, c equals left-parenthesis left-parenthesis 1 slash n Subscript 1 dot Baseline plus 1 slash n Subscript 2 dot Baseline right-parenthesis slash 2 right-parenthesis. The column 1 and column 2 risks use the same continuity correction.

By default when you specify the RISKDIFF option, PROC FREQ also provides exact (Clopper-Pearson) confidence limits for the column 1, column 2, and overall risks. These confidence limits are constructed by inverting the equal-tailed test that is based on the binomial distribution. For more information, see the section Exact (Clopper-Pearson) Confidence Limits.

Confidence Limits for the Risk Difference

PROC FREQ provides the following confidence limit types for the risk difference: Agresti-Caffo, exact unconditional, Hauck-Anderson, Miettinen-Nurminen (score), Newcombe (hybrid-score), and Wald confidence limits. Continuity-corrected forms of Newcombe and Wald confidence limits are also available.

The confidence coefficient for the confidence limits produced by the CL= riskdiff-option is 100 left-parenthesis 1 minus alpha right-parenthesis%, where the value of alpha is determined by the ALPHA= option. By default, ALPHA=0.05, which produces 95% confidence limits. This differs from the test-based confidence limits that are provided with the equivalence, noninferiority, and superiority tests, which have a confidence coefficient of 100 left-parenthesis 1 minus 2 alpha right-parenthesis% (Schuirmann 1999). For more information, see the section Risk Difference Tests.

Agresti-Caffo Confidence Limits
Agresti-Caffo confidence limits for the risk difference are computed as

d overTilde plus-or-minus left-parenthesis z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis d overTilde right-parenthesis right-parenthesis

where d overTilde equals p overTilde Subscript 1 Baseline minus p overTilde Subscript 2, p overTilde Subscript i Baseline equals left-parenthesis n Subscript i Baseline 1 Baseline plus 1 right-parenthesis slash left-parenthesis n Subscript i dot Baseline plus 2 right-parenthesis,

normal s normal e left-parenthesis d overTilde right-parenthesis equals StartRoot p overTilde Subscript 1 Baseline left-parenthesis 1 minus p overTilde Subscript 2 Baseline right-parenthesis slash left-parenthesis n Subscript 1 dot Baseline plus 2 right-parenthesis plus p overTilde Subscript 2 Baseline left-parenthesis 1 minus p overTilde Subscript 2 Baseline right-parenthesis slash left-parenthesis n Subscript 2 dot Baseline plus 2 right-parenthesis EndRoot

and z Subscript alpha slash 2 is the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesisth percentile of the standard normal distribution.

The Agresti-Caffo interval adjusts the Wald interval for the risk difference by adding a pseudo-observation of each type (success and failure) to each sample. See Agresti and Caffo (2000) and Agresti and Coull (1998) for more information.

Hauck-Anderson Confidence Limits
Hauck-Anderson confidence limits for the risk difference are computed as

ModifyingAbove d With caret plus-or-minus left-parenthesis c plus z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis right-parenthesis

where ModifyingAbove d With caret equals ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2 and z Subscript alpha slash 2 is the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesisth percentile of the standard normal distribution. The standard error is computed from the sample proportions as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript 1 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis slash left-parenthesis n Subscript 1 dot Baseline minus 1 right-parenthesis plus ModifyingAbove p With caret Subscript 2 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis slash left-parenthesis n Subscript 2 dot Baseline minus 1 right-parenthesis EndRoot

The Hauck-Anderson continuity correction c is computed as

c equals 1 slash left-parenthesis 2 min left-parenthesis n Subscript 1 dot Baseline comma n Subscript 2 dot Baseline right-parenthesis right-parenthesis

For more information, see Hauck and Anderson (1986). The subsection "Hauck-Anderson Test" in the section Noninferiority Tests describes the corresponding noninferiority test.

Miettinen-Nurminen (Score) Confidence Limits
Miettinen-Nurminen (score) confidence limits for the risk difference (Miettinen and Nurminen 1985) are computed by inverting score tests for the risk difference. A score-based test statistic for the null hypothesis that the risk difference equals delta can be expressed as

upper T left-parenthesis delta right-parenthesis equals left-parenthesis ModifyingAbove d With caret minus delta right-parenthesis slash StartRoot ModifyingAbove normal upper V normal a normal r With tilde left-parenthesis delta EndRoot right-parenthesis

where ModifyingAbove d With caret is the observed value of the risk difference (ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2),

ModifyingAbove normal upper V normal a normal r With tilde left-parenthesis delta right-parenthesis equals left-parenthesis n slash left-parenthesis n minus 1 right-parenthesis right-parenthesis left-parenthesis ModifyingAbove p With tilde Subscript 1 Baseline left-parenthesis delta right-parenthesis left-parenthesis 1 minus ModifyingAbove p With tilde Subscript 1 Baseline left-parenthesis delta right-parenthesis right-parenthesis slash n 1 plus ModifyingAbove p With tilde Subscript 2 Baseline left-parenthesis delta right-parenthesis left-parenthesis 1 minus ModifyingAbove p With tilde Subscript 2 Baseline left-parenthesis delta right-parenthesis right-parenthesis slash n 2 right-parenthesis

and ModifyingAbove p With tilde Subscript 1 Baseline left-parenthesis delta right-parenthesis and ModifyingAbove p With tilde Subscript 2 Baseline left-parenthesis delta right-parenthesis are the maximum likelihood estimates of the row 1 and row 2 risks (proportions) under the restriction that the risk difference is delta. For more information, see Miettinen and Nurminen (1985, pp. 215–216) and Miettinen (1985, chapter 12).

The 100 left-parenthesis 1 minus alpha right-parenthesis% confidence interval for the risk difference consists of all values of delta for which the score test statistic upper T left-parenthesis delta right-parenthesis falls in the acceptance region,

StartSet delta colon upper T left-parenthesis delta right-parenthesis less-than z Subscript alpha slash 2 Baseline EndSet

where z Subscript alpha slash 2 is the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesisth percentile of the standard normal distribution. PROC FREQ finds the confidence limits by iterative computation, which stops when the iteration increment falls below the convergence criterion or when the maximum number of iterations is reached, whichever occurs first. By default, the convergence criterion is 0.00000001 and the maximum number of iterations is 100.

By default, the Miettinen-Nurminen confidence limits include the bias correction factor n slash left-parenthesis n minus 1 right-parenthesis in the computation of ModifyingAbove normal upper V normal a normal r With tilde left-parenthesis delta right-parenthesis (Miettinen and Nurminen 1985, p. 216). For more information, see Newcombe and Nurminen (2011). If you specify the CL=MN(CORRECT=NO) riskdiff-option, PROC FREQ does not include the bias correction factor in this computation (Mee 1984). See also Agresti (2002, p. 77). The uncorrected confidence limits are labeled as "Miettinen-Nurminen-Mee" confidence limits in the displayed output.

The maximum likelihood estimates of p 1 and p 2, subject to the constraint that the risk difference is delta, are computed as

p overTilde Subscript 1 Baseline equals 2 u cosine left-parenthesis w right-parenthesis minus b slash 3 a normal a normal n normal d p overTilde Subscript 2 Baseline equals p overTilde Subscript 1 Baseline minus delta

where

StartLayout 1st Row 1st Column w 2nd Column equals 3rd Column left-parenthesis pi plus cosine Superscript negative 1 Baseline left-parenthesis v slash u cubed right-parenthesis right-parenthesis slash 3 2nd Row 1st Column v 2nd Column equals 3rd Column b cubed slash left-parenthesis 3 a right-parenthesis cubed minus b c slash 6 a squared plus d slash 2 a 3rd Row 1st Column u 2nd Column equals 3rd Column normal s normal i normal g normal n left-parenthesis v right-parenthesis StartRoot b squared slash left-parenthesis 3 a right-parenthesis squared minus c slash 3 a EndRoot 4th Row 1st Column a 2nd Column equals 3rd Column 1 plus theta 5th Row 1st Column b 2nd Column equals 3rd Column minus left-parenthesis 1 plus theta plus ModifyingAbove p With caret Subscript 1 Baseline plus theta ModifyingAbove p With caret Subscript 2 Baseline plus delta left-parenthesis theta plus 2 right-parenthesis right-parenthesis 6th Row 1st Column c 2nd Column equals 3rd Column delta squared plus delta left-parenthesis 2 ModifyingAbove p With caret Subscript 1 Baseline plus theta plus 1 right-parenthesis plus ModifyingAbove p With caret Subscript 1 Baseline plus theta ModifyingAbove p With caret Subscript 2 7th Row 1st Column d 2nd Column equals 3rd Column minus ModifyingAbove p With caret Subscript 1 Baseline delta left-parenthesis 1 plus delta right-parenthesis 8th Row 1st Column theta 2nd Column equals 3rd Column n Subscript 2 dot Baseline slash n Subscript 1 dot EndLayout

For more information, see Farrington and Manning (1990, p. 1453).

Newcombe Confidence Limits
Newcombe (hybrid-score) confidence limits for the risk difference are constructed from the Wilson score confidence limits for each of the two individual proportions. The confidence limits for the individual proportions are used in the standard error terms of the Wald confidence limits for the proportion difference. See Newcombe (1998a) and Barker et al. (2001) for more information.

Wilson score confidence limits for p 1 and p 2 are the roots of

StartAbsoluteValue p Subscript i Baseline minus ModifyingAbove p With caret Subscript i Baseline EndAbsoluteValue equals z Subscript alpha slash 2 Baseline StartRoot p Subscript i Baseline left-parenthesis 1 minus p Subscript i Baseline right-parenthesis slash n Subscript i dot Baseline EndRoot

for i equals 1 comma 2. The confidence limits are computed as

left parenthesis ModifyingAbove p With caret Subscript i Baseline plus z Subscript alpha divided by 2 Superscript 2 Baseline divided by 2 n Subscript i dot Baseline plus or minus z Subscript alpha divided by 2 Baseline StartRoot left parenthesis ModifyingAbove p With caret Subscript i Baseline left parenthesis 1 minus ModifyingAbove p With caret Subscript i Baseline right parenthesis plus z Subscript alpha divided by 2 Superscript 2 Baseline divided by 4 n Subscript i dot Baseline right parenthesis divided by n Subscript i dot Baseline EndRoot right parenthesis slash left parenthesis 1 plus z Subscript alpha divided by 2 Superscript 2 Baseline divided by n Subscript i dot Baseline right parenthesis

For more information, see the section Wilson (Score) Confidence Limits.

Denote the lower and upper Wilson score confidence limits for p 1 as upper L 1 and upper U 1, and denote the lower and upper confidence limits for p 2 as upper L 2 and upper U 2. The Newcombe confidence limits for the proportion difference (d equals p 1 minus p 2) are computed as

StartLayout 1st Row  d Subscript upper L Baseline equals left-parenthesis ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis minus StartRoot left-parenthesis ModifyingAbove p With caret Subscript 1 Baseline minus upper L 1 right-parenthesis squared plus left-parenthesis upper U 2 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis squared EndRoot 2nd Row  d Subscript upper U Baseline equals left-parenthesis ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis plus StartRoot left-parenthesis upper U 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis squared plus left-parenthesis ModifyingAbove p With caret Subscript 2 Baseline minus upper L 2 right-parenthesis squared EndRoot EndLayout

If you specify the CORRECT riskdiff-option, PROC FREQ provides continuity-corrected Newcombe confidence limits. By including a continuity correction of 1 slash 2 n Subscript i dot, the Wilson score confidence limits for the individual proportions are computed as the roots of

StartAbsoluteValue p Subscript i Baseline minus ModifyingAbove p With caret Subscript i Baseline EndAbsoluteValue minus 1 slash 2 n Subscript i dot Baseline equals z Subscript alpha slash 2 Baseline StartRoot p Subscript i Baseline left-parenthesis 1 minus p Subscript i Baseline right-parenthesis slash n Subscript i dot Baseline EndRoot

The continuity-corrected confidence limits for the individual proportions are then used to compute the proportion difference confidence limits d Subscript upper L and d Subscript upper U.

Wald Confidence Limits
Wald confidence limits for the risk difference are computed as

ModifyingAbove d With caret plus-or-minus left-parenthesis z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis right-parenthesis

where ModifyingAbove d With caret equals ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2, z Subscript alpha slash 2 is the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesisth percentile of the standard normal distribution. and the standard error is computed from the sample proportions as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript 1 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis slash n Subscript 1 dot Baseline plus ModifyingAbove p With caret Subscript 2 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis slash n Subscript 2 dot Baseline EndRoot

If you specify the CORRECT riskdiff-option, the Wald confidence limits include a continuity correction c,

ModifyingAbove d With caret plus-or-minus left-parenthesis c plus z Subscript alpha slash 2 Baseline times normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis right-parenthesis

where c equals left-parenthesis 1 slash n Subscript 1 dot Baseline plus 1 slash n Subscript 2 dot Baseline right-parenthesis slash 2.

The subsection "Wald Test" in the section Noninferiority Tests describes the corresponding noninferiority test.

Exact Unconditional Confidence Limits
If you specify the RISKDIFF option in the EXACT statement, PROC FREQ provides exact unconditional confidence limits for the risk difference (d equals p 1 minus p 2). The exact unconditional approach fixes the row margins of the 2 times 2 table and eliminates the nuisance parameter p 2 by using the maximum p-value (worst-case scenario) over all possible values of p 2 (Santner and Snell 1980). The conditional approach, which is described in the section Exact Statistics, does not apply to the risk difference because of the nuisance parameter (Agresti 1992).

By default, PROC FREQ computes the confidence limits by the tail method, which inverts two separate one-sided exact tests of the risk difference, where the tests are based on the score statistic (Chan and Zhang 1999). The size of each one-sided exact test is at most alpha slash 2, and the confidence coefficient is at least left-parenthesis 1 minus alpha right-parenthesis. If you specify the RISKDIFF(METHOD=NOSCORE) option in the EXACT statement, PROC FREQ computes the confidence limits by inverting two separate one-sided exact tests that are based on the unstandardized risk difference. If you specify the RISKDIFF(METHOD=SCORE2) option in the EXACT statement, PROC FREQ computes the confidence limits by inverting a single two-sided exact test that is based on the score statistic (Agresti and Min 2001).

The score statistic is a less discrete statistic than the unstandardized risk difference and produces less conservative confidence limits (Agresti and Min 2001). For more information, see Santner et al. (2007). The section "Miettinen-Nurminen (Score) Confidence Limits" describe computation of the risk difference score statistic. For more information, see Miettinen and Nurminen (1985) and Farrington and Manning (1990).

PROC FREQ computes the exact unconditional confidence limits as follows. The risk difference is defined as the difference between the row 1 and row 2 risks (proportions), d equals p 1 minus p 2, and n 1 and n 2 denote the row totals of the 2 times 2 table. The joint probability function for the table can be expressed in terms of the table cell frequencies, the risk difference, and the nuisance parameter p 2 as

f left-parenthesis n 11 comma n 21 semicolon n 1 comma n 2 comma d comma p 2 right-parenthesis equals StartBinomialOrMatrix n 1 Choose n 11 EndBinomialOrMatrix left-parenthesis d plus p 2 right-parenthesis Superscript n 11 Baseline left-parenthesis 1 minus d minus p 2 right-parenthesis Superscript n 1 minus n 11 Baseline times StartBinomialOrMatrix n 2 Choose n 21 EndBinomialOrMatrix p 2 Superscript n 21 Baseline left-parenthesis 1 minus p 2 right-parenthesis Superscript n 2 minus n 21

For the tail method (which inverts two separate one-sided exact tests), the 100 left-parenthesis 1 minus alpha slash 2 right-parenthesis% confidence limits for the risk difference are computed as

StartLayout 1st Row 1st Column d Subscript upper L 2nd Column equals 3rd Column sup left-parenthesis d Subscript asterisk Baseline colon upper P Subscript upper U Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis greater-than alpha slash 2 right-parenthesis 2nd Row 1st Column d Subscript upper U 2nd Column equals 3rd Column inf left-parenthesis d Subscript asterisk Baseline colon upper P Subscript upper L Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis greater-than alpha slash 2 right-parenthesis EndLayout

where

StartLayout 1st Row 1st Column upper P Subscript upper U Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis 2nd Column equals 3rd Column sup Underscript p 2 Endscripts left-parenthesis sigma-summation Underscript upper A comma upper T left-parenthesis a right-parenthesis greater-than-or-equal-to t 0 Endscripts f left-parenthesis n 11 comma n 21 semicolon n 1 comma n 2 comma d Subscript asterisk Baseline comma p 2 right-parenthesis right-parenthesis 2nd Row 1st Column upper P Subscript upper L Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis 2nd Column equals 3rd Column sup Underscript p 2 Endscripts left-parenthesis sigma-summation Underscript upper A comma upper T left-parenthesis a right-parenthesis less-than-or-equal-to t 0 Endscripts f left-parenthesis n 11 comma n 21 semicolon n 1 comma n 2 comma d Subscript asterisk Baseline comma p 2 right-parenthesis right-parenthesis EndLayout

The set A includes all 2 times 2 tables in which the row sums are n 1 and n 2, upper T left-parenthesis a right-parenthesis denotes the value of the test statistic for table a in A, and t 0 is the value of the test statistic for the observed table. The test statistic is either the score statistic (by default) or the unstandardized risk difference. To compute upper P Subscript upper U Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis, the sum includes probabilities of those tables for which left-parenthesis upper T left-parenthesis a right-parenthesis greater-than-or-equal-to t 0 right-parenthesis. For a fixed value of d Subscript asterisk, upper P Subscript upper U Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis is defined as the maximum sum over all possible values of p 2.

The two-sided score method evaluates the p-values upper P Subscript upper U Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis and upper P Subscript upper L Baseline left-parenthesis d Subscript asterisk Baseline right-parenthesis by comparing StartAbsoluteValue upper T left-parenthesis a right-parenthesis EndAbsoluteValue to StartAbsoluteValue t 0 EndAbsoluteValue. To compute the confidence limits d Subscript upper L and d Subscript u, the two-sided method compares the p-values to alpha. For more information, see Agresti and Min (2001) and Santner et al. (2007).

Risk Difference Tests

PROC FREQ provides tests of equality, noninferiority, superiority, and equivalence for the risk (proportion) difference. The following analysis methods are available: Wald (with and without continuity correction), Hauck-Anderson, Farrington-Manning (score), and Newcombe (with and without continuity correction). You can specify the method by using the METHOD= riskdiff-option; by default, PROC FREQ provides Wald tests.

Equality Tests

The equality test for the risk difference tests the null hypothesis that the risk difference equals the null value. You can specify a null value by using the EQUAL(NULL=) riskdiff-option; by default, the null value is 0. This test can be expressed as upper H 0 colon d equals d 0 versus the alternative upper H Subscript a Baseline colon d not-equals d 0, where d equals p 1 minus p 2 denotes the risk difference (for column 1 or column 2) and d 0 denotes the null value.

The test statistic is computed as

z equals left-parenthesis ModifyingAbove d With caret minus d 0 right-parenthesis slash normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis

where the standard error normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis is computed by using the method that you specify. Available methods for the equality test include Wald (with and without continuity correction), Hauck-Anderson, and Farrington-Manning (score). For a description of the standard error computation, see the subsections "Wald Test," "Hauck-Anderson Test," and "Farrington-Manning (Score) Test," respectively, in the section Noninferiority Tests.

PROC FREQ computes one-sided and two-sided p-values for equality tests. When the test statistic z is greater than 0, PROC FREQ displays the right-sided p-value, which is the probability of a larger value occurring under the null hypothesis. The one-sided p-value can be expressed as

upper P 1 equals StartLayout Enlarged left-brace 1st Row  normal upper P normal r normal o normal b left-parenthesis upper Z greater-than z right-parenthesis normal i normal f z greater-than 0 2nd Row  normal upper P normal r normal o normal b left-parenthesis upper Z less-than z right-parenthesis normal i normal f z less-than-or-equal-to 0 EndLayout

where Z has a standard normal distribution. The two-sided p-value is computed as upper P 2 equals 2 times upper P 1.

Noninferiority Tests

If you specify the NONINF riskdiff-option, PROC FREQ provides a noninferiority test for the risk difference, or the difference between two proportions. The null hypothesis for the noninferiority test is

upper H 0 colon p 1 minus p 2 less-than-or-equal-to negative delta

versus the alternative

upper H Subscript a Baseline colon p 1 minus p 2 greater-than negative delta

where delta is the noninferiority margin. Rejection of the null hypothesis indicates that the row 1 risk is not inferior to the row 2 risk. See Chow, Shao, and Wang (2003) for more information.

You can specify the value of delta with the MARGIN= riskdiff-option. By default, delta equals 0.2. You can specify the test method with the METHOD= riskdiff-option. The following methods are available for the risk difference noninferiority analysis: Wald (with and without continuity correction), Hauck-Anderson, Farrington-Manning (score), and Newcombe (with and without continuity correction). The Wald, Hauck-Anderson, and Farrington-Manning methods provide tests and corresponding test-based confidence limits; the Newcombe method provides only confidence limits. If you do not specify METHOD=, PROC FREQ uses the Wald test by default.

The confidence coefficient for the test-based confidence limits is 100 left-parenthesis 1 minus 2 alpha right-parenthesis% (Schuirmann 1999). By default, if you do not specify the ALPHA= option, these are 90% confidence limits. You can compare the confidence limits to the noninferiority limit, –delta.

The following sections describe the noninferiority analysis methods for the risk difference.

Wald Test
If you specify the METHOD=WALD riskdiff-option, PROC FREQ provides an asymptotic Wald test of noninferiority for the risk difference. This is also the default method. The Wald test statistic is computed as

z equals left-parenthesis ModifyingAbove d With caret plus delta right-parenthesis slash normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis

where (ModifyingAbove d With caret equals ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2) estimates the risk difference and delta is the noninferiority margin.

By default, the standard error for the Wald test is computed from the sample proportions as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript 1 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis slash n Subscript 1 dot Baseline plus ModifyingAbove p With caret Subscript 2 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis slash n Subscript 2 dot Baseline EndRoot

If you specify the VAR=NULL riskdiff-option, the standard error is based on the null hypothesis that the risk difference equals –delta (Dunnett and Gent 1977). The standard error is computed as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot p overTilde left-parenthesis 1 minus p overTilde right-parenthesis slash n Subscript 2 dot Baseline plus left-parenthesis p overTilde minus delta right-parenthesis left-parenthesis 1 minus p overTilde plus delta right-parenthesis slash n Subscript 1 dot Baseline EndRoot

where

p overTilde equals left-parenthesis n 11 plus n 21 plus delta n Subscript 1 dot Baseline right-parenthesis slash n

If you specify the CORRECT riskdiff-option, the test statistic includes a continuity correction. The continuity correction is subtracted from the numerator of the test statistic if the numerator is greater than 0; otherwise, the continuity correction is added to the numerator. The value of the continuity correction is left-parenthesis 1 slash n Subscript 1 dot Baseline plus 1 slash n Subscript 2 dot Baseline right-parenthesis slash 2.

The p-value for the Wald noninferiority test is upper P Subscript z Baseline equals normal upper P normal r normal o normal b left-parenthesis upper Z greater-than z right-parenthesis, where Z has a standard normal distribution.

Hauck-Anderson Test
If you specify the METHOD=HA riskdiff-option, PROC FREQ provides the Hauck-Anderson test for noninferiority. The Hauck-Anderson test statistic is computed as

z equals left-parenthesis ModifyingAbove d With caret plus delta plus-or-minus c right-parenthesis slash normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis

where ModifyingAbove d With caret equals ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2 and the standard error is computed from the sample proportions as

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot ModifyingAbove p With caret Subscript 1 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 1 Baseline right-parenthesis slash left-parenthesis n Subscript 1 dot Baseline minus 1 right-parenthesis plus ModifyingAbove p With caret Subscript 2 Baseline left-parenthesis 1 minus ModifyingAbove p With caret Subscript 2 Baseline right-parenthesis slash left-parenthesis n Subscript 2 dot Baseline minus 1 right-parenthesis EndRoot

The Hauck-Anderson continuity correction c is computed as

c equals 1 slash left-parenthesis 2 min left-parenthesis n Subscript 1 dot Baseline comma n Subscript 2 dot Baseline right-parenthesis right-parenthesis

The p-value for the Hauck-Anderson noninferiority test is upper P Subscript z Baseline equals normal upper P normal r normal o normal b left-parenthesis upper Z greater-than z right-parenthesis, where Z has a standard normal distribution. See Hauck and Anderson (1986) and Schuirmann (1999) for more information.

Farrington-Manning (Score) Test
If you specify the METHOD=FM riskdiff-option, PROC FREQ provides the Farrington-Manning (score) test of noninferiority for the risk difference. A score test statistic for the null hypothesis that the risk difference equals –delta can be expressed as

z equals left-parenthesis ModifyingAbove d With caret plus delta right-parenthesis slash normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis

where ModifyingAbove d With caret is the observed value of the risk difference (ModifyingAbove p With caret Subscript 1 Baseline minus ModifyingAbove p With caret Subscript 2),

normal s normal e left-parenthesis ModifyingAbove d With caret right-parenthesis equals StartRoot p overTilde Subscript 1 Baseline left-parenthesis 1 minus p overTilde Subscript 1 Baseline right-parenthesis slash n Subscript 1 dot Baseline plus p overTilde Subscript 2 Baseline left-parenthesis 1 minus p overTilde Subscript 2 Baseline right-parenthesis slash n Subscript 2 dot Baseline EndRoot

and p overTilde Subscript 1 and p overTilde Subscript 2 are the maximum likelihood estimates of the row 1 and row 2 risks (proportions) under the restriction that the risk difference is –delta. The p-value for the noninferiority test is upper P Subscript z Baseline equals normal upper P normal r normal o normal b left-parenthesis upper Z greater-than z right-parenthesis, where Z has a standard normal distribution. For more information, see Miettinen and Nurminen (1985); Miettinen (1985); Farrington and Manning (1990); Dann and Koch (2005).

The maximum likelihood estimates of p 1 and p 1, subject to the constraint that the risk difference is –delta, are computed as

p overTilde Subscript 1 Baseline equals 2 u cosine left-parenthesis w right-parenthesis minus b slash 3 a normal a normal n normal d p overTilde Subscript 2 Baseline equals p overTilde Subscript 1 Baseline plus delta

where

StartLayout 1st Row 1st Column w 2nd Column equals 3rd Column left-parenthesis pi plus cosine Superscript negative 1 Baseline left-parenthesis v slash u cubed right-parenthesis right-parenthesis slash 3 2nd Row 1st Column v 2nd Column equals 3rd Column b cubed slash left-parenthesis 3 a right-parenthesis cubed minus b c slash 6 a squared plus d slash 2 a 3rd Row 1st Column u 2nd Column equals 3rd Column normal s normal i normal g normal n left-parenthesis v right-parenthesis StartRoot b squared slash left-parenthesis 3 a right-parenthesis squared minus c slash 3 a EndRoot 4th Row 1st Column a 2nd Column equals 3rd Column 1 plus theta 5th Row 1st Column b 2nd Column equals 3rd Column minus left-parenthesis 1 plus theta plus ModifyingAbove p With caret Subscript 1 Baseline plus theta ModifyingAbove p With caret Subscript 2 Baseline minus delta left-parenthesis theta plus 2 right-parenthesis right-parenthesis 6th Row 1st Column c 2nd Column equals 3rd Column delta squared minus delta left-parenthesis 2 ModifyingAbove p With caret Subscript 1 Baseline plus theta plus 1 right-parenthesis plus ModifyingAbove p With caret Subscript 1 Baseline plus theta ModifyingAbove p With caret Subscript 2 7th Row 1st Column d 2nd Column equals 3rd Column ModifyingAbove p With caret Subscript 1 Baseline delta left-parenthesis 1 minus delta right-parenthesis 8th Row 1st Column theta 2nd Column equals 3rd Column n Subscript 2 dot Baseline slash n Subscript 1 dot EndLayout

For more information, see Farrington and Manning (1990, p. 1453).

Newcombe Noninferiority Analysis
If you specify the METHOD=NEWCOMBE riskdiff-option, PROC FREQ provides a noninferiority analysis that is based on Newcombe hybrid-score confidence limits for the risk difference. The confidence coefficient for the confidence limits is 100 left-parenthesis 1 minus 2 alpha right-parenthesis% (Schuirmann 1999). By default, if you do not specify the ALPHA= option, these are 90% confidence limits. You can compare the confidence limits with the noninferiority limit, –delta. If you specify the CORRECT riskdiff-option, the confidence limits includes a continuity correction. See the subsection "Newcombe Confidence Limits" in the section Confidence Limits for the Risk Difference for more information.

Superiority Test

If you specify the SUP riskdiff-option, PROC FREQ provides a superiority test for the risk difference. The null hypothesis is

upper H 0 colon colon p 1 minus p 2 less-than-or-equal-to delta

versus the alternative

upper H Subscript a Baseline colon p 1 minus p 2 greater-than delta

where delta is the superiority margin. Rejection of the null hypothesis indicates that the row 1 proportion is superior to the row 2 proportion. You can specify the value of delta with the MARGIN= riskdiff-option. By default, delta equals 0.2.

The superiority analysis is identical to the noninferiority analysis but uses a positive value of the margin delta in the null hypothesis. The superiority computations follow those in the section Noninferiority Tests by replacing –delta by delta. See Chow, Shao, and Wang (2003) for more information.

Equivalence Test

If you specify the EQUIV riskdiff-option, PROC FREQ provides an equivalence test for the risk difference, or the difference between two proportions. The null hypothesis for the equivalence test is

upper H 0 colon p 1 minus p 2 less-than-or-equal-to minus delta Subscript upper L Baseline normal o normal r p 1 minus p 2 greater-than-or-equal-to delta Subscript upper U Baseline

versus the alternative

upper H Subscript a Baseline colon delta Subscript upper L Baseline less-than p 1 minus p 2 less-than delta Subscript upper U Baseline

where delta Subscript upper L is the lower margin and delta Subscript upper U is the upper margin. Rejection of the null hypothesis indicates that the two binomial proportions are equivalent. See Chow, Shao, and Wang (2003) for more information.

You can specify the value of the margins delta Subscript upper L and delta Subscript upper U with the MARGIN= riskdiff-option. If you do not specify MARGIN=, PROC FREQ uses lower and upper margins of –0.2 and 0.2 by default. If you specify a single margin value delta, PROC FREQ uses lower and upper margins of –delta and delta. You can specify the test method with the METHOD= riskdiff-option. The following methods are available for the risk difference equivalence analysis: Wald (with and without continuity correction), Hauck-Anderson, Farrington-Manning (score), and Newcombe (with and without continuity correction). The Wald, Hauck-Anderson, and Farrington-Manning methods provide tests and corresponding test-based confidence limits; the Newcombe method provides only confidence limits. If you do not specify METHOD=, PROC FREQ uses the Wald test by default.

PROC FREQ computes two one-sided tests (TOST) for equivalence analysis (Schuirmann 1987). The TOST approach includes a right-sided test for the lower margin delta Subscript upper L and a left-sided test for the upper margin delta Subscript upper U. The overall p-value is taken to be the larger of the two p-values from the lower and upper tests.

The section Noninferiority Tests gives details about the Wald, Hauck-Anderson, Farrington-Manning (score), and Newcombe methods for the risk difference. The lower margin equivalence test statistic takes the same form as the noninferiority test statistic but uses the lower margin value delta Subscript upper L in place of –delta. The upper margin equivalence test statistic take the same form as the noninferiority test statistic but uses the upper margin value delta Subscript upper U in place of –delta.

The test-based confidence limits for the risk difference are computed according to the equivalence test method that you select. If you specify METHOD=WALD with VAR=NULL, or METHOD=FM, separate standard errors are computed for the lower and upper margin tests. In this case, the test-based confidence limits are computed by using the maximum of these two standard errors. These confidence limits have a confidence coefficient of 100 left-parenthesis 1 minus 2 alpha right-parenthesis% (Schuirmann 1999). By default, if you do not specify the ALPHA= option, these are 90% confidence limits. You can compare the test-based confidence limits to the equivalence limits, left-parenthesis delta Subscript upper L Baseline comma delta Subscript upper U Baseline right-parenthesis.

Barnard’s Unconditional Exact Test

The BARNARD option in the EXACT statement provides an unconditional exact test for the risk (proportion) difference for 2 times 2 tables. The reference set for the unconditional exact test consists of all 2 times 2 tables that have the same row sums as the observed table (Barnard 1945, 1947, 1949). This differs from the reference set for exact conditional inference, which is restricted to the set of tables that have the same row sums and the same column sums as the observed table. See the sections Fisher’s Exact Test and Exact Statistics for more information.

The test statistic is the standardized risk difference, which is computed as

upper T equals d slash StartRoot p Subscript dot 1 Baseline left-parenthesis 1 minus p Subscript dot 1 Baseline right-parenthesis left-parenthesis 1 slash n 1 plus 1 slash n 2 right-parenthesis EndRoot

where the risk difference d is defined as the difference between the row 1 and row 2 risks (proportions), d equals left-parenthesis n 11 slash n 1 minus n 21 slash n 2 right-parenthesis; n 1 and n 2 are the row 1 and row 2 totals, respectively; and p Subscript dot 1 is the overall proportion in column 1, left-parenthesis n 11 plus n 21 right-parenthesis slash n.

Under the null hypothesis that the risk difference is 0, the joint probability function for a table can be expressed in terms of the table cell frequencies, the row totals, and the unknown parameter pi as

f left-parenthesis n 11 comma n 21 semicolon n 1 comma n 2 comma pi right-parenthesis equals StartBinomialOrMatrix n 1 Choose n 11 EndBinomialOrMatrix StartBinomialOrMatrix n 2 Choose n 21 EndBinomialOrMatrix pi Superscript n 11 plus n 21 Baseline left-parenthesis 1 minus pi right-parenthesis Superscript n minus n 11 minus n 21

where pi is the common value of the risk (proportion).

PROC FREQ sums the table probabilities over the reference set for those tables where the test statistic is greater than or equal to the observed value of the test statistic. This sum can be expressed as

normal upper P normal r normal o normal b left-parenthesis pi right-parenthesis equals sigma-summation Underscript upper A comma upper T left-parenthesis a right-parenthesis greater-than-or-equal-to t 0 Endscripts f left-parenthesis n 11 comma n 21 semicolon n 1 comma n 2 comma pi right-parenthesis

where the set A contains all 2 times 2 tables with row sums equal to n 1 and n 2, and upper T left-parenthesis a right-parenthesis denotes the value of the test statistic for table a in A. The sum includes probabilities of those tables for which (upper T left-parenthesis a right-parenthesis greater-than-or-equal-to t 0), where t 0 is the value of the test statistic for the observed table.

The sum Prob(pi) depends on the unknown value of pi. To compute the exact p-value, PROC FREQ eliminates the nuisance parameter pi by taking the maximum value of Prob(pi) over all possible values of pi,

normal upper P normal r normal o normal b equals sup Underscript left-parenthesis 0 less-than-or-equal-to pi less-than-or-equal-to 1 right-parenthesis Endscripts left-parenthesis normal upper P normal r normal o normal b left-parenthesis pi right-parenthesis right-parenthesis

See Suissa and Shuster (1985) and Mehta and Senchaudhuri (2003).

Last updated: December 09, 2022