The FREQ Procedure

Odds Ratio and Relative Risks for 2 $\times $ 2 Tables

Odds Ratio

The odds ratio is a useful measure of association for a variety of study designs. For a retrospective design called a case-control study, the odds ratio can be used to estimate the relative risk when the probability of positive response is small (Agresti 2002). In a case-control study, two independent samples are identified based on a binary (yes-no) response variable, and the conditional distribution of a binary explanatory variable is examined within fixed levels of the response variable. For more information, see Stokes, Davis, and Koch (2012), Agresti (2013), and Agresti (2007).

The odds of a positive response (column 1) in row 1 is $ n_{11} / n_{12}$. Similarly, the odds of a positive response in row 2 is $ n_{21} / n_{22}$. The odds ratio is formed as the ratio of the row 1 odds to the row 2 odds. The odds ratio for a $2 \times 2$ table is defined as

\[ \mathit{OR} = \frac{n_{11}/n_{12}}{n_{21}/n_{22}} = \frac{n_{11} ~ n_{22}}{n_{12} ~ n_{21}} \]

The odds ratio can be any nonnegative number. When the row and column variables are independent, the true value of the odds ratio is 1. An odds ratio greater than 1 indicates that the odds of a positive response are higher in row 1 than in row 2. An odds ratio less than 1 indicates that the odds of a positive response are higher in row 2. The strength of association increases as the deviation from 1 increases.

The transformation $G = (\mathit{OR}-1)/(\mathit{OR}+1)$ transforms the odds ratio to the range (–1,1), where G = 0 when $\mathit{OR} = 1$; G = –1 when $\mathit{OR} = 0$; and G approaches 1 as OR approaches infinity. G is the gamma statistic, which PROC FREQ computes when you specify the MEASURES option.

Confidence Limits for the Odds Ratio

The following types of confidence limits are available for the odds ratio: exact, exact mid-p, likelihood ratio, score, Wald, and Wald modified.

Wald Confidence Limits
The asymptotic Wald confidence limits are based on a log transformation of the odds ratio (Woolf 1955; Haldane 1955). PROC FREQ computes the Wald confidence limits as

\[ \left( ~ \mathit{OR} \times \exp ( -z \sqrt {v} ), ~ ~ \mathit{OR} \times \exp ( z \sqrt {v} ) ~ \right) \]

where

\[ v = \mr{Var} (\ln \mathit{OR}) = 1/n_{11} + 1/n_{12} + 1/n_{21} + 1/n_{22} \]

and z is the $100(1-\alpha /2)$th percentile of the standard normal distribution. The confidence level $\alpha $ is determined by the ALPHA= option in the TABLES statement; by default, ALPHA=0.05, which produces 95% confidence limits for the odds ratio. If any of the four cell frequencies are 0, v is undefined and the Wald confidence limits cannot be computed. For more information, see Agresti (2013, p. 70).

Wald Modified Confidence Limits
PROC FREQ computes Wald modified confidence limits (Haldane 1955) for the odds ratio by replacing the $n_{ij}$ by $(n_{ij} + 0.5)$ in the estimator $\mathit{OR}$ and the variance v as follows:

\[ \mathit{OR} = \frac{(n_{11} + 0.5) ~ (n_{22} + 0.5)}{(n_{12} + 0.5) ~ (n_{21} + 0.5)} \]
\[ v = \mr{Var} (\ln \mathit{OR}) = 1/(n_{11} + 0.5) + 1/(n_{12} + 0.5) + 1/(n_{21} + 0.5) + 1/(n_{22} + 0.5) \]

The modified confidence limits are then computed as

\[ \left( ~ \mathit{OR} \times \exp ( -z \sqrt {v} ), ~ ~ \mathit{OR} \times \exp ( z \sqrt {v} ) ~ \right) \]

where z is the $100(1-\alpha /2)$th percentile of the standard normal distribution. For more information, see Fleiss, Levin, and Paik (2003) and Agresti (2013).

Score Confidence Limits
Score confidence limits for the odds ratio (Miettinen and Nurminen 1985) are computed by inverting score tests for the odds ratio. A score-based chi-square test statistic for the null hypothesis that the odds ratio equals $\theta $ can be expressed as

\[ Q(\theta ) = \{ n_{1 \cdot } \left( \hat{p}_1 - \tilde{p}_1 \right) \} ^2 ~ / ~ \{ n / (n-1) \} ~ \{ 1 / \left( n_{1 \cdot } \tilde{p}_1 ( 1 - \tilde{p}_1 ) \right) + 1 / \left( n_{2 \cdot } \tilde{p}_2 ( 1 - \tilde{p}_2 ) \right) \} ^{-1} \]

where $\hat{p}_1$ is the observed row 1 risk ($n_{11}/n_{1 \cdot }$), and $\tilde{p}_1$ and $\tilde{p}_2$ are the maximum likelihood estimates of the row 1 and row 2 risks under the restriction that the odds ratio ($n_{11} n_{22} / n_{12} n_{21}$) is $\theta $. For more information, see Miettinen and Nurminen (1985) and Miettinen (1985, chapter 14).

The $100(1-\alpha )$% score confidence interval for the odds ratio consists of all values of $\theta $ for which the test statistic $Q(\theta )$ falls in the acceptance region,

\[ \{ \theta : Q(\theta ) < \chi ^2_{1, \alpha } \} \]

where $\chi ^2_{1, \alpha }$ is the 100$(1-\alpha )$th percentile of the chi-square distribution with 1 degree of freedom. For more information about score confidence limits, see Agresti (2013).

By default, the score confidence limits include the bias correction factor $n/(n-1)$ in the denominator of $Q(\theta )$ (Miettinen and Nurminen 1985, p. 217). If you specify the CL=SCORE(CORRECT=NO) option, PROC FREQ does not include this factor in the computation.

The maximum likelihood estimates of $p_1$ and $p_2$, subject to the constraint that the odds ratio is $\theta $, are computed as

\[ \tilde{p}_2 = \left( -b + \sqrt { b^2 - 4 a c } \right) / 2a \hspace{.15in} \mr{and} \hspace{.15in} \tilde{p}_1 = \tilde{p}_2 \theta / \left( 1 + \tilde{p}_2 (\theta - 1) \right) \]

where

\begin{eqnarray*} a & = & n_{2 \cdot } (\theta - 1 ) \\ b & = & n_{1 \cdot } \theta + n_{2 \cdot } - \hat{p}_{\cdot 1} (\theta - 1) \\ c & = & - \hat{p}_{\cdot 1} \end{eqnarray*}

For more information, see Miettinen and Nurminen (1985, pp. 217–218) and Miettinen (1985, chapter 14).

Likelihood Ratio Confidence Limits
Likelihood ratio (profile likelihood) confidence limits for the odds ratio are computed by inverting likelihood ratio tests. The likelihood ratio test statistic for the null hypothesis that the odds ratio equals $\theta $ can be expressed as

\[ G^2(\theta ) ~ = ~ 2 ~ \bigl ( n_{11} \ln ( \hat{p}_1 / \tilde{p}_1 ) ~ + ~ n_{12} \ln ( (1-\hat{p}_1) / (1-\tilde{p}_1 ) ~ + ~ n_{21} \ln ( \hat{p}_2 / \tilde{p}_2 ) ~ + ~ n_{22} \ln ( (1-\hat{p}_2 / (1-\tilde{p}_2 ) \bigr ) \]

where $\hat{p}_ i$ is the observed row i risk ($n_{11}/n_{1 \cdot }$) and $\tilde{p}_ i$ is the maximum likelihood estimate of the row i risk under the restriction that the odds ratio is $\theta $. The computation of the maximum likelihood estimates is described in the subsection "Score Confidence Limits" in this section. For more information, see Agresti (2013), Miettinen and Nurminen (1985), and Miettinen (1985, chapter 14).

The $100(1-\alpha )$% likelihood ratio confidence interval for the odds ratio consists of all values of $\theta $ for which the test statistic $G^2(\theta )$ falls in the acceptance region,

\[ \{ \theta : G^2(\theta ) < \chi ^2_{1, \alpha } \} \]

where $\chi ^2_{1, \alpha }$ is the 100$(1-\alpha )$th percentile of the chi-square distribution with 1 degree of freedom.

Exact Confidence Limits
PROC FREQ computes exact confidence limits for the odds ratio by inverting two one-sided (equal-tail) exact tests that are based on the noncentral hypergeometric distribution, where the distribution is conditional on the observed marginal totals of the $2 \times 2$ table. The exact confidence limits $\phi _1$ and $\phi _2$ are the solutions to the equations

\begin{eqnarray*} \sum _{i=n_{11}}^{n_{\cdot 1}} f( i : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _1 ) ~ & = & ~ \alpha /2 \\ \sum _{i=0}^{n_{11}} f( i : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _2 ) ~ & = & ~ \alpha /2 \end{eqnarray*}

where

\[ f( i : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi ) = \binom {n_{1 \cdot }}{i} \binom {n_{2 \cdot }}{n_{\cdot 1} - i} ~ \phi ^ i ~ ~ / ~ ~ \sum _{i=0}^{n_{\cdot 1}} \binom {n_{1 \cdot }}{i} \binom {n_{2 \cdot }}{n_{\cdot 1}-i} ~ \phi ^ i \]

For more information, see Fleiss, Levin, and Paik (2003), Thomas (1971), and Gart (1971).

Because this is a discrete problem, the confidence coefficient for the exact confidence interval is not exactly $(1-\alpha )$ but is at least $(1-\alpha )$; thus, these confidence limits are conservative. For more information, see Agresti (1992).

When the odds ratio is 0, which occurs when either $n_{11} = 0$ or $n_{22} = 0$, PROC FREQ sets the lower exact confidence limit to 0 and determines the upper limit by using the level $\alpha $ (instead of $\alpha /2$). Similarly, when the odds ratio is infinity, which occurs when either $n_{12} = 0$ or $n_{21} = 0$, PROC FREQ sets the upper exact confidence limit to infinity and determines the lower limit by using level $\alpha $.

Exact Mid-p Confidence Limits
PROC FREQ computes exact mid-p confidence limits for the odds ratio by inverting two one-sided hypergeometric tests that include mid-p tail areas. The mid-p approach replaces the probability of the observed table by half of that probability in the hypergeometric probability sums, which are described in the subsection "Exact Confidence Limits" in this section. The exact mid-p confidence limits $\phi _1$ and $\phi _2$ are the solutions to the equations

\begin{eqnarray*} \sum _{i=n_{11}+1}^{n_{\cdot 1}} \bigl ( f( i : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _1 ) \bigr ) ~ + ~ (1/2) f( n_{11} : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _1 ) ~ & = & ~ \alpha /2 \\ \sum _{i=0}^{n_{11}-1} \bigl ( f( i : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _2 ) \bigr ) ~ + ~ (1/2) f( n_{11} : n_{\cdot 1}, ~ n_{1 \cdot }, ~ n_{2 \cdot }, ~ \phi _2 ) ~ & = & ~ \alpha /2 \end{eqnarray*}

where

\[ f( i : n_{\cdot 1}, n_{1 \cdot }, n_{2 \cdot }, \phi ) = \binom {n_{1 \cdot }}{i} \binom {n_{2 \cdot }}{n_{\cdot 1} - i} ~ \phi ^ i ~ ~ / ~ ~ \sum _{i=0}^{n_{\cdot 1}} \binom {n_{1 \cdot }}{i} \binom {n_{2 \cdot }}{n_{\cdot 1}-i} ~ \phi ^ i \]

For more information, see Agresti (2013).

When the odds ratio is 0, which occurs when either $n_{11} = 0$ or $n_{22} = 0$, PROC FREQ sets the lower exact confidence limit to 0 and determines the upper limit by using the level $\alpha $ (instead of $\alpha /2$). Similarly, when the odds ratio is infinity, which occurs when either $n_{12} = 0$ or $n_{21} = 0$, PROC FREQ sets the upper exact confidence limit to infinity and determines the lower limit by using level $\alpha $.

Relative Risks

Relative risks are useful measures in cohort (prospective) study designs, where two samples are identified based on the presence or absence of an explanatory factor. The two samples are observed in future time for the binary (yes-no) response variable under study. Relative risks are also useful in cross-sectional studies, where two variables are observed simultaneously. For more information, see Stokes, Davis, and Koch (2012) and Agresti (2007).

The relative risk is the ratio of the row 1 risk to the row 2 risk in a $2 \times 2$ table. The column 1 risk in row 1 is the proportion of row 1 observations that are classified in column 1, which can be expressed as

\[ p_1 = n_{11} ~ / ~ n_{1 \cdot } \]

Similarly, the column 1 risk in row 2 is

\[ p_2 = n_{21} ~ / ~ n_{2 \cdot } \]

The column 1 relative risk is computed as

\[ R = p_1 ~ / ~ p_2 \]

A relative risk greater than 1 indicates that the probability of positive response is greater in row 1 than in row 2. Similarly, a relative risk less than 1 indicates that the probability of positive response is less in row 1 than in row 2. The strength of association increases as the deviation from 1 increases.

Confidence Limits for the Relative Risk

PROC FREQ provides the following types of confidence limits for the relative risk: exact unconditional, likelihood ratio, score, Wald, and Wald modified.

Wald Confidence Limits
The asymptotic Wald confidence limits are based on a log transformation of the relative risk. PROC FREQ computes the Wald confidence limits for the column 1 relative risk as

\[ \left( ~ \hat{r} \times \exp ( -z \sqrt {v} ) , ~ ~ \hat{r} \times \exp ( z \sqrt {v} ) ~ \right) \]

where $\hat{r}$ is the observed value of the relative risk, $\hat{p}_1 / \hat{p}_2$, and

\[ v = \mr{Var}(\ln (\hat{r})) = \bigl ( (1-\hat{p}_1) / n_{11} \bigr ) ~ + ~ \bigl ( (1-\hat{p}_2) / n_{21} \bigr ) \]

and z is the $100(1-\alpha /2)$th percentile of the standard normal distribution. The confidence level $\alpha $ is determined by the ALPHA= option in the TABLES statement; by default, ALPHA=0.05, which produces 95% confidence limits. If either cell frequency $n_{11}$ or $n_{21}$ is 0, then v is undefined and the Wald confidence limits cannot be computed.

PROC FREQ computes the confidence limits for the column 2 relative risk in the same way.

Wald Modified Confidence Limits
PROC FREQ computes Wald modified confidence limits (Haldane 1955) for the relative risk by replacing the $n_{ij}$ with $(n_{ij} + 0.5)$ and the $n_{i \cdot }$ with $(n_{i \cdot } + 0.5)$ in the estimator R and the variance v as follows:

\[ \hat{r}_\mi {m} = \hat{p}_1 / \hat{p}_2 = \frac{ (n_{11} + 0.5) / (n_{1 \cdot } + 0.5) }{ (n_{21} + 0.5) / (n_{2 \cdot } + 0.5) } \]
\[ v = \mr{Var}(\ln (\hat{r}_\mi {m})) = 1/(n_{11} + 0.5) + 1/(n_{21} + 0.5) - 1/(n_{1 \cdot } + 0.5) - 1/(n_{2 \cdot } + 0.5) \]

The confidence limits are computed as

\[ \left( ~ \hat{r}_\mi {m} \times \exp ( -z \sqrt {v} ), ~ ~ \hat{r}_ mi{m} \times \exp ( z \sqrt {v} ) ~ \right) \]

where z is the $100(1-\alpha /2)$th percentile of the standard normal distribution. For more information, see Fleiss, Levin, and Paik (2003) and Agresti (2013).

Score Confidence Limits
Score confidence limits (Miettinen and Nurminen 1985; Farrington and Manning 1990) are computed by inverting score tests for the relative risk. A score-based chi-square test statistic for the null hypothesis that the relative risk is $r_0$ can be expressed as

\[ Q(r_0) = ( \hat{p}_1 - r_0 \hat{p}_2 )^2 ~ / ~ \widetilde{\mr{Var}}(r_0) \]

where $\hat{p}_1$ and $\hat{p}_2$ are the observed row 1 and row 2 risks (proportions), respectively,

\[ \widetilde{\mr{Var}}(r_0) = \left( n / (n-1) \right) ~ \left( ~ \tilde{p}_1 (1-\tilde{p}_1) / n_{1 \cdot } ~ +~ {r_0}^2 ~ \tilde{p}_2 (1-\tilde{p}_2) / n_{2 \cdot } ~ \right) \]

where $\tilde{p}_1$ and $\tilde{p}_2$ are the maximum likelihood estimates of $p_1$ and $p_2$, respectively, under the null hypothesis that the relative risk is $r_0$. For more information, see Miettinen and Nurminen (1985) and Miettinen (1985, chapter 13).

The $100(1-\alpha )$% score confidence interval for the relative risk consists of all values of $r_0$ for which the test statistic $Q(r_0)$ falls in the acceptance region,

\[ \{ r_0: Q(r_0) < \chi ^2_{1, \alpha } \} \]

where $\chi ^2_{1, \alpha }$ is the 100$(1-\alpha )$th percentile of the chi-square distribution with 1 degree of freedom. For more information, see Agresti (2013).

By default, the score confidence limits include the bias correction factor $n/(n-1)$ in the denominator of $Q(r_0)$ (Miettinen and Nurminen 1985, p. 217). If you specify the CL=SCORE(CORRECT=NO) option, PROC FREQ does not include this factor in the computation.

The maximum likelihood estimates of $p_1$ and $p_2$, subject to the constraint that the relative risk is $r_0$, are computed as

\[ \tilde{p}_1 = \left( -b - \sqrt {b^2 - 4ac} \right) / 2a \hspace{.15in} \mr{and} \hspace{.15in} \tilde{p}_2 = \tilde{p}_1 / r_0 \]

where

\begin{eqnarray*} a & = & 1 + \theta \\ b & = & - \left( r_0 ( 1 + \theta \hat{p}_2 ) + \theta + \hat{p}_1 \right) \\ c & = & r_0 ( \hat{p}_1 + \theta \hat{p}_2 ) \\ \theta & = & n_{2 \cdot } / n_{1 \cdot } \end{eqnarray*}

For more information, see Farrington and Manning (1990, p. 1454) and Miettinen and Nurminen (1985, p. 217).

Likelihood Ratio Confidence Limits
Likelihood ratio (profile likelihood) confidence limits for the relative risk are computed by inverting likelihood ratio tests. The likelihood ratio test statistic for the null hypothesis that the relative risk ratio is $r_0$ can be expressed as

\[ G^2(r_0) ~ = ~ 2 ~ \bigl ( n_{11} \ln ( \hat{p}_1 / \tilde{p}_1 ) ~ + ~ n_{12} \ln ( (1-\hat{p}_1) / (1-\tilde{p}_1 ) ~ + ~ n_{21} \ln ( \hat{p}_2 / \tilde{p}_2 ) ~ + ~ n_{22} \ln ( (1-\hat{p}_2 / (1-\tilde{p}_2 ) \bigr ) \]

where $\hat{p}_ i$ is the observed row i risk ($n_{i1}/n_{i \cdot }$) and $\tilde{p}_ i$ is the maximum likelihood estimate of the row i risk under the restriction that the relative risk is $r_0$. Expressions for the maximum likelihood estimates $\tilde{p}_1$ and $\tilde{p}_2$ are given in the subsection "Score Confidence Limits" in this section. For more information, see Miettinen and Nurminen (1985) and Miettinen (1985, chapter 13).

The $100(1-\alpha )$% likelihood ratio confidence interval for the relative risk consists of all values of $r_0$ for which the test statistic $G^2(r_0)$ falls in the acceptance region,

\[ \{ \theta : G^2(r_0) < \chi ^2_{1, \alpha } \} \]

where $\chi ^2_{1, \alpha }$ is the 100$(1-\alpha )$th percentile of the chi-square distribution with 1 degree of freedom.

Exact Unconditional Confidence Limits
PROC FREQ computes exact unconditional confidence limits for the relative risk by inverting two separate one-sided tests (tail method). The size of each test is at most $\alpha /2$ and the confidence coefficient is at least $(1-\alpha )$. The exact conditional method, which is described in the section Exact Statistics, does not apply to the relative risk because of a nuisance parameter (Agresti 1992). The unconditional method (which fixes only the row margins of the $2 \times 2$ table) eliminates the nuisance parameter by maximizing the p-value over all possible values of the parameter (Santner and Snell 1980). This computation method is described in the subsection "Exact Unconditional Confidence Limits" in the section Confidence Limits for the Risk Difference.

By default, PROC FREQ uses the unstandardized relative risk as the test statistic to compute the confidence limits. To ensure that the statistic is defined when there are zero-frequency tables cells, PROC FREQ uses the following modified form of the unstandardized relative risk, which adds 0.5 to the cell and row frequencies (Gart and Nam 1988):

\[ \hat{r} = \frac{ (n_{11} + 0.5) ~ / ~ (n_{1 \cdot } + 0.5) }{ (n_{21} + 0.5) ~ / ~ (n_{2 \cdot } + 0.5) } \]

For more information, see the subsection "Wald Modified Confidence Limits" in this section.

If you specify the RELRISK(METHOD=SCORE) option, PROC FREQ uses the relative risk score statistic as the test statistic to compute the confidence limits (Chan and Zhang 1999). The score statistic is a less discrete statistic than the unstandardized relative risk and produces less conservative confidence limits (Agresti and Min 2001). For more information, see Santner et al. (2007).

The relative risk score statistic (Miettinen and Nurminen 1985; Farrington and Manning 1990) is computed as

\[ z(r_0) = ( \hat{p}_1 - r_0 \hat{p}_2 ) ~ / ~ \mr{se}(r_0) \]

where

\[ \mr{se}(r_0) = \sqrt { \tilde{p}_1 (1-\tilde{p}_1) / n_{1 \cdot } ~ +~ {r_0}^2 ~ \tilde{p}_2 (1-\tilde{p}_2) / n_{2 \cdot } } \]

where $\tilde{p}_1$ and $\tilde{p}_2$ are the maximum likelihood estimates of $p_1$ and $p_2$ under the restriction that the relative risk is $r_0$. Expressions for the maximum likelihood estimates $\tilde{p}_1$ and $\tilde{p}_2$ are given in the subsection "Score Confidence Limits" in this section. For more information, see Farrington and Manning (1990, p. 1454) and Miettinen and Nurminen (1985, p. 217).

Relative Risk Tests

PROC FREQ provides tests of equality, noninferiority, superiority, and equivalence for the relative risk. The following analysis methods are available: Wald (which is based on a log transformation), Wald modified, score, and likelihood ratio. You can specify the method by using the METHOD= relrisk-option; by default, PROC FREQ provides Wald tests.

Equality Test
An equality test for the relative risk can be expressed as

\[ H_0\colon R = r_0 \]

versus the alternative

\[ H_ a\colon R \neq r_0 \]

where $R = p_1 / p_2$ denotes the relative risk (for column 1 or column 2) and $r_0$ denotes the null value. You can specify a null value by using the EQUAL(NULL=) relrisk-option; by default, the null value is 1.

The test statistic is computed by the method that you specify; by default, PROC FREQ uses the Wald test. For information about test statistic computation, see the subsections "Wald Test," "Wald Modified Test," "Farrington-Manning (Score) Test," and "Likelihood Ratio Test" in this section.

For the Wald and score methods, the test statistics z have standard normal distributions under the null hypothesis. For the likelihood ratio test, the test statistic $G^2$ has a chi-square distribution with 1 degree of freedom under the null hypothesis.

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

\begin{equation*} P_1 = \begin{cases} \mr{Prob} (Z > z) \quad \mr{if} \hspace{.1in} z > 0 \\ \mr{Prob} (Z < z) \quad \mr{if} \hspace{.1in} z \leq 0 \\ \end{cases}\end{equation*}

where Z has a standard normal distribution. The two-sided p-value is computed as $P_2 = 2 \times P_1$.

Noninferiority Test
A noninferiority test for the relative risk can be expressed as

\[ H_0\colon R \leq \delta \]

versus the alternative

\[ H_ a\colon R > \delta \]

where $R = p_1 / p_2$ denotes the relative risk (for column 1 or column 2) and $\delta $ denotes the noninferiority margin (limit). You can specify the margin by using the MARGIN= relrisk-option; by default, the noninferiority margin is 0.8. The noninferiority margin for a relative risk test should be less than 1. Rejection of the null hypothesis indicates that the row 1 risk is not inferior to the row 2 risk. For more information, see Chow, Shao, and Wang (2008).

The test statistic z is computed by the method that you specify. For information about test statistic computation, see the subsections "Wald Test," "Wald Modified Test," "Farrington-Manning (Score) Test," and "Likelihood Ratio Test" in this section. The test statistic z is computed by using the noninferiority margin (limit) as the null value of the relative risk. Under the null hypothesis, the test statistic has a standard normal distribution. The p-value for the noninferiority test is the right-sided p-value (the probability that $Z > z$).

As part of the noninferiority analysis, PROC FREQ also provides confidence limits for the relative risk. The confidence coefficient is $100(1-2\alpha )$% (Schuirmann 1999). The confidence level $\alpha $ is determined by the ALPHA= option in the TABLES statement; by default, ALPHA=0.05, which produces 90% confidence limits for the noninferiority analysis. You can compare the confidence limits to the value of the noninferiority limit $\delta $.

Superiority Test
A superiority test for the relative risk can be expressed as

\[ H_0\colon R \leq \delta \]

versus the alternative

\[ H_ a\colon R > \delta \]

where $R = p_1 / p_2$ denotes the relative risk (for column 1 or column 2) and $\delta $ denotes the superiority margin (limit). You can specify the margin by using the MARGIN= relrisk-option; by default, the superiority margin is 1.25. The superiority margin for a relative risk test should be greater than 1. Rejection of the null hypothesis indicates that the row 1 risk is superior to the row 2 risk. For more information, see Chow, Shao, and Wang (2008).

The test statistic z is computed by using the superiority margin (limit) as the null value of the relative risk. Under the null hypothesis, the test statistic has a standard normal distribution. The p-value for the superiority test is the right-sided p-value (the probability that $Z > z$).

The computations for the superiority analysis are the same as the computations for the noninferiority analysis, which are described in the subsection "Noninferiority Test" in this section.

Equivalence Test
An equivalence test for the relative risk can be expressed as

\[ H_0\colon R \leq \delta _{\mi{L}} \hspace{.15in} \mr{or} \hspace{.15in} R \geq \delta _{\mi{U}} \]

versus the alternative

\[ H_ a\colon \delta _{\mi{L}} < R < \delta _{\mi{U}} \]

where $\delta _{\mi{L}}$ is the lower margin and $\delta _{\mi{U}}$ is the upper margin. Rejection of the null hypothesis indicates that the two risks are equivalent. For more information, see Chow, Shao, and Wang (2008).

You can specify the margins by using the MARGIN= relrisk-option; by default, the lower margin is 0.8 and the upper margin is 1.25. If you specify a single margin value, PROC FREQ uses this value as the lower margin for the equivalence test and computes the upper margin as the inverse of the lower margin.

PROC FREQ computes two one-sided tests (TOST) for equivalence analysis (Schuirmann 1987), which include a right-sided test for the lower margin $\delta _{\mi{L}}$ and a left-sided test for the upper margin $\delta _{\mi{U}}$. The lower test statistic uses the lower margin as the null relative risk value, and the p-value is the right-sided probability ($Z > z_\mi {L}$). The upper test statistic uses the upper margin as the null value, and the p-value is the left-sided probability ($Z < z_\mi {U}$). The overall p-value is taken to be the larger of the two p-values for the lower and upper tests.

The test statistics are computed by the method that you specify. For more information about the test statistic computation, see the subsections "Wald Test," "Wald Modified Test," "Farrington-Manning (Score) Test," and "Likelihood Ratio Test" in this section.

As part of the equivalence analysis, PROC FREQ also provides confidence limits for the relative risk. The confidence coefficient is $100(1-2\alpha )$% (Schuirmann 1999). The confidence level $\alpha $ is determined by the ALPHA= option in the TABLES statement; by default, ALPHA=0.05, which produces 90% confidence limits for the equivalence analysis. You can compare the confidence limits to the equivalence limits, which are $\delta _{\mi{L}}$ and $\delta _{\mi{U}}$.

Wald Test
The Wald test statistic (which is based on a log transformation of the relative risk) is computed as $z(r_0) = ( \ln (\hat{r}) - \ln (r_0) ) / \sqrt (v)$, where $\hat{r}$ is the relative risk estimate ($\hat{p}_1 / \hat{p}_2$), $r_0$ is the null value of the relative risk, and

\[ v = \mr{Var}(\ln (\hat{r})) = 1/n_{11} + 1/(n_{21} - 1/n_{1 \cdot } - 1/n_{2 \cdot } \]

The null value is determined by the type of test (equality, noninferiority, superiority, or equivalence) and the null or margin values that you specify. The side of the p-value and the interpretation of the test are also determined by the type of test; for more information, see the subsections "Equality Test," "Noninferiority Test," "Superiority Test," and "Equivalence Test" in this section.

Wald Modified Test
The Wald modified test statistic is computed by replacing the $n_{ij}$ with $(n_{ij} + 0.5)$ and the $n_{i \cdot }$ with $(n_{i \cdot } + 0.5)$ in the relative risk estimator R and the variance v. The test statistic is computed as $z(r_0) = ( \ln (\hat{r}) - \ln (r_0) ) / sqrt(v)$, where $r_0$ is the null value of the relative risk,

\[ \hat{r} = \hat{p}_1 / \hat{p}_2 = \frac{ (n_{11} + 0.5) / (n_{1 \cdot } + 0.5) }{ (n_{21} + 0.5) / (n_{2 \cdot } + 0.5) } \]
\[ v = \mr{Var}(\ln (\hat{r})) = 1/(n_{11} + 0.5) + 1/(n_{21} + 0.5) - 1/(n_{1 \cdot } + 0.5) - 1/(n_{2 \cdot } + 0.5) \]

The null value is determined by the type of test (equality, noninferiority, superiority, or equivalence) and the null or margin values that you specify. The side of the p-value and the interpretation of the test are also determined by the type of test; for more information, see the subsections "Equality Test," "Noninferiority Test," "Superiority Test," and "Equivalence Test" in this section.

Farrington-Manning (Score) Test
The relative risk score test statistic (Miettinen and Nurminen 1985; Farrington and Manning 1990) for the null value $r_0$ is computed as

\[ z(r_0) = ( \hat{p}_1 - r_0 \hat{p}_2 ) ~ / ~ \mr{se}(r_0) \]

where

\[ \mr{se}(r_0) = \sqrt { \tilde{p}_1 (1-\tilde{p}_1) / n_{1 \cdot } ~ +~ {r_0}^2 ~ \tilde{p}_2 (1-\tilde{p}_2) / n_{2 \cdot } } \]

where $\tilde{p}_1$ and $\tilde{p}_2$ are the maximum likelihood estimates of $p_1$ and $p_2$ under the null value $r_0$. Expressions for the maximum likelihood estimates $\tilde{p}_1$ and $\tilde{p}_2$ are given in the subsection "Score Confidence Limits" in this section.

The null value is determined by the type of test (equality, noninferiority, superiority, or equivalence) and the null or margin values that you specify. The side of the p-value and the interpretation of the test are also determined by the type of test; for more information, see the subsections "Equality Test," "Noninferiority Test," "Superiority Test," and "Equivalence Test" in this section.

Likelihood Ratio Test
The likelihood ratio statistic for the null relative risk value $r_0$ is computed as

\[ G^2(r_0) ~ = ~ 2 ~ \bigl ( n_{11} \ln ( \hat{p}_1 / \tilde{p}_1 ) ~ + ~ n_{12} \ln ( (1-\hat{p}_1) / (1-\tilde{p}_1 ) ~ + ~ n_{21} \ln ( \hat{p}_2 / \tilde{p}_2 ) ~ + ~ n_{22} \ln ( (1-\hat{p}_2 / (1-\tilde{p}_2 ) \bigr ) \]

where $\tilde{p}_1$ and $\tilde{p}_2$ are the maximum likelihood estimates of $p_1$ and $p_2$ under the null value $r_0$. Expressions for the maximum likelihood estimates $\tilde{p}_1$ and $\tilde{p}_2$ are given in the subsection "Score Confidence Limits" in this section. For more information, see Miettinen and Nurminen (1985) and Miettinen (1985, chapter 13).

PROC FREQ computes the likelihood ratio test statistic $z(r_0)$ for the noninferiority, superiority, and equivalence tests as $\sqrt {G^2(r_0)}$, where the sign is positive if the estimate is greater than the null value ($\hat{r} \geq r_0$) and negative otherwise ($\hat{r} < r_0$).

The null value is determined by the type of test (equality, noninferiority, superiority, or equivalence) and the null or margin values that you specify. The side of the p-value and the interpretation of the test are also determined by the type of test; for more information, see the subsections "Equality Test," "Noninferiority Test," "Superiority Test," and "Equivalence Test" in this section.