The attributable fraction measures the excess event rate or risk fraction in the exposed population that is attributable to the exposure. That is, it is the proportion of event rate or risk in the exposed population that would be reduced if the exposure were not present. In contrast, the population attributable fraction measures the excess event rate or risk fraction in the total population that is attributable to the exposure.
In the STDRATE procedure, you can compute the attributable fraction by using either indirect standardization or MantelHaenszel estimation.
With indirect standardization, you specify a study population that consists of subjects who are exposed to a factor, such as smoking, and a reference population that consists of subjects who are not exposed to the factor. Denote the numbers of events in the study and reference populations by and , respectively.
For the rate estimate, denote the populationtimes in the study and reference populations by and , respectively. Then the event rates in the two populations can be expressed as the following equations, respectively:

Similarly, for the risk estimate, denote the numbers of observations in the study and reference populations by and , respectively. Then the event risks in the two populations can be expressed as the following equations, respectively:

In the next two subsections, denotes the rate statistic and denotes the risk statistic.
The attributable fraction is the fraction of event rate or risk in the exposed population that is attributable to exposure:

With a standardized mortality ratio , the attributable fraction is estimated by

The confidence intervals for the attributable fraction can be computed using the confidence intervals for . That is, with a confidence interval for , the corresponding confidence interval is given by

The population attributable fraction for a population is the fraction of event rate or risk in a given time period that is attributable to exposure. The population attributable fraction is

where

is the combined rate in the total population for the rate statistic and where

is the combined risk in the total population for the risk statistic.
Denote , the proportion of exposure among events, then can also be expressed as

where is the standardized mortality ratio.
An approximate confidence interval for the population attributable rate can be derived by using the complementary log transformation (Greenland, 2008, p. 296). That is, with

a variance estimator for the estimated is given by

where is a variance estimate for .
With MantelHaenszel estimation, you specify one study population that consists of subjects who are exposed to a factor and another study population that consists of subjects who are not exposed to the factor. Denote the numbers of events in the exposed and nonexposed study populations by and , respectively.
For the rate estimate, denote the populationtimes in the two populations by and , respectively. Then the event rates in the two populations can be expressed as the following equations, respectively:

Similarly, for the risk estimate, denote the numbers of observations in the two populations by and , respectively. Then the event risks in the two populations can be expressed as the following equations, respectively:

In the next two subsections, denotes the rate statistic and denotes the risk statistic.
The attributable fraction is the fraction of event rate or risk in the exposed population that is attributable to exposure:

Denote the rate or risk ratio by . The attributable fraction is given by

The confidence intervals for the attributable fraction can be computed using the confidence intervals for the rate or risk ratio . That is, with a confidence interval for , the corresponding confidence interval is given by

For MantelHaenszel estimation, you can use the MantelHaenszel rate or risk ratio to estimate .
The population attributable fraction for a population is the fraction of event rate or risk in a given time period that is attributable to exposure. The population attributable fraction is

where

is the combined rate in the total population for the rate statistic and where

is the combined risk in the total population for the risk statistic.
Denote the proportion of exposure among events as . Then can also be expressed as

where is the rate or risk ratio.
An approximate confidence interval for the population attributable rate can be derived by using the complementary log transformation (Greenland, 2008, p. 296). That is, with

a variance estimator for the estimated is given by

where is a variance estimate for .
For MantelHaenszel estimation, you can use the MantelHaenszel rate or risk ratio to estimate .