InfyCalculator
❤️

Attack Rate Calculator: Food-Specific Attack Rates and Risk Ratio

Analyse a point-source outbreak 2×2 table: food-specific attack rates for eaters and non-eaters, overall attack rate, risk ratio and risk difference with 90/95/99% confidence intervals, odds ratio, chi-square and Fisher exact p-values, attributable fractions and the household secondary attack rate.

Exposed (ate the food) and ill
Exposed and well
Not exposed and ill
Not exposed and well
Household contacts of cases (for secondary attack rate, optional)
Household contacts who became ill
Confidence level
Loading calculator…

How it works

Attack rate = ill ÷ everyone in the group · RR = AR(exposed) ÷ AR(unexposed) · SE(ln RR) = √(1/a − 1/(a+b) + 1/c − 1/(c+d)) · CI = RR × e^(±z·SE) · RD = AR(exposed) − AR(unexposed) · OR = ad ÷ bc · AFe = (RR − 1) ÷ RR · PAF = pₑ(RR − 1) ÷ [1 + pₑ(RR − 1)] · χ² = n(ad − bc)² ÷ [(a+b)(c+d)(a+c)(b+d)] · SAR = ill contacts ÷ contacts

In a point-source outbreak such as a wedding dinner or a church supper, investigators interview every attendee about what they ate and whether they fell ill, then build a 2×2 table for each menu item: a = ate and ill, b = ate and well, c = did not eat and ill, d = did not eat and well. The food-specific attack rate is the share of each group who became ill (strictly an incidence proportion, not a rate). The implicated food shows a high attack rate among eaters, a low one among non-eaters, a large risk ratio whose confidence interval excludes 1, and it accounts for most of the cases. The calculator gives the risk ratio with a log-scale (Katz) confidence interval, the risk difference, the odds ratio for comparison, the uncorrected and Yates chi-square, and the two-sided Fisher exact p-value, which is the one to use when an expected cell count is below 5. If a cell is zero it adds 0.5 to every cell for the ratio estimates (Haldane correction). The attributable fraction among the exposed is the share of the eaters' illness explained by the food, and the population attributable fraction (Levin's formula) is the share of all cases. The secondary attack rate counts household contacts who fell ill at least one incubation period later, divided by all contacts excluding the primary cases; a high value points to an agent that spreads person to person, such as norovirus or Shigella, rather than a preformed toxin.

Worked example

Of 64 guests who ate the chicken salad, 46 fell ill: an attack rate of 46 ÷ 64 = 71.9%. Of 46 who did not eat it, 7 fell ill: 15.2%. The risk ratio is 71.9 ÷ 15.2 = 4.72. SE(ln RR) = √(1/46 − 1/64 + 1/7 − 1/46) = 0.3567, so the 95% CI is 4.72 × e^(±1.96 × 0.3567) = 2.35 to 9.50. The risk difference is 56.7 percentage points, χ² = 34.4 and the Fisher exact p is below 0.001. The attributable fraction among eaters is (4.72 − 1) ÷ 4.72 = 79%, and with 58% of attendees exposed the population attributable fraction is 68%; 87% of the cases ate the salad. Among 60 household contacts, 9 fell ill later, a secondary attack rate of 15.0% (95% CI 8.1–26.1%), which suggests some person-to-person spread.

Sources: CDC, Principles of Epidemiology, Lesson 3: Measures of Risk · epiR epi.2by2 documentation (risk ratio, attributable fractions, tests) · Statistical tools for outbreak investigation (MetricGate)

Frequently asked questions

How do you calculate a food-specific attack rate?

Divide the number of people who ate the food and became ill by everyone who ate it, and multiply by 100. If 30 of 99 people who ate potato salad fell ill, the attack rate is 30 ÷ 99 × 100 = 30.3%. Do the same for people who did not eat it and compare the two.

How do I find the food that caused the outbreak?

Make a 2×2 table for every item on the menu. The likely vehicle has a high attack rate among eaters, a low one among non-eaters, the largest risk ratio with a confidence interval above 1, and it was eaten by most of the cases. Laboratory testing of leftovers and stool samples confirms it.

Why do several foods show elevated risk ratios?

Foods eaten together are correlated, so people who took the salad also took the dressing. The vehicle usually has the highest risk ratio and attributable fraction and explains the cases who ate nothing else suspicious; stratified analysis separates them.

What if nobody unexposed was ill?

The risk ratio is infinite. Report both attack rates, a 0.5-corrected estimate and the Fisher exact p-value. It is very strong evidence, not a calculation failure.

Should I use the risk ratio or the odds ratio?

Use the risk ratio when you interviewed everyone at the event (a cohort). Use the odds ratio when you compared a sample of cases with a sample of well controls (a case-control study), because attack rates cannot be calculated then. With high attack rates the odds ratio is much larger than the risk ratio.

What is the secondary attack rate?

The share of contacts of primary cases who fall ill within one incubation period. The denominator is the household members minus the primary cases. CDC's example: 17 secondary cases among 86 − 18 = 68 contacts is 25%.

Related calculators

Standard epidemiological formulas (CDC Principles of Epidemiology, Rothman) with large-sample confidence intervals and an exact test. Results depend on case definitions, ascertainment and study design; they inform, and do not replace, formal analysis by an epidemiologist or public-health authority.