1. Introduction

In epidemiology, measuring disease frequency is the first step in the “Epidemiologic Cycle.” We move from anecdotal evidence (e.g., “there seems to be a lot of flu”) to quantitative data (e.g., “the incidence is 5 per 1,000 person-years”).

2. Fractions in Epidemiology

There are three fundamental ways to express the relationship between a numerator (\(x\)) and a denominator (\(y\)).

Type Definition Example
Ratio \(x\) is not part of \(y\) 5 males : 10 females
Proportion \(x\) is a part of \(y\) 5 cases / 100 people (5%)
Rate Proportion + Time element 5 cases per 1,000 people per year

3. Prevalence (The “Snap-shot”)

Prevalence measures the total number of cases (old and new) in a population at a specific point in time.

Formula: \[P = \frac{\text{Number of existing cases}}{\text{Total Population}} \times 10^n\]

Real-Life Example: HIV/AIDS

In a country with 1,000,000 people, if 50,000 people are currently living with HIV, the prevalence is \(5\%\). Prevalence is useful for resource planning (e.g., how many hospital beds or doses of medication are needed today).


4. Incidence (The “Video”)

Incidence measures the flow of new cases into a population.

4.1 Cumulative Incidence (Risk)

The probability that an individual will develop the disease over a specific period. \[CI = \frac{\text{New cases during period}}{\text{Population at risk at the start}}\]

4.2 Incidence Rate (Person-Time)

Used when people are followed for different amounts of time. \[IR = \frac{\text{New cases}}{\text{Sum of person-time units}}\]


5. Visualizing the Relationship

The relationship between Incidence and Prevalence is often described using the “Bathtub Analogy.”


6. Real-Life Application Case Study

Scenario: A Flu Outbreak in a Nursing Home

Calculations:

  1. Point Prevalence (Jan 1): \(10 / 200 = 5\%\)
  2. Cumulative Incidence (Jan): \(30 / (200 - 10) = 15.7\%\) (Note: We subtract the 10 who already had it because they weren’t ‘at risk’ of catching it again).
  3. Case Fatality Rate (CFR): \(2 / (10 + 30) = 5\%\) (Deaths divided by total people who had the disease).

7. Summary of Measures

Measure Numerator Denominator Utility
Prevalence All cases Total population Planning / Burden
Incidence New cases Population at risk Etiology / Risk
Case Fatality Deaths from disease Total cases Disease Severity

8. Practice Exercise

A community of 10,000 people is monitored for “Disease X” over one year. - At the start, 500 have it. - During the year, 200 new cases are diagnosed. - 50 people die from the disease.

Task: Calculate the Period Prevalence and the Cumulative Incidence using R.

pop <- 10000
existing <- 500
new_cases <- 200

# Calculate
period_prevalence <- ((existing + new_cases) / pop) * 100
cum_incidence <- (new_cases / (pop - existing)) * 1000

print(paste("Period Prevalence:", period_prevalence, "%"))
## [1] "Period Prevalence: 7 %"
print(paste("Cumulative Incidence:", round(cum_incidence, 2), "per 1,000 at risk"))
## [1] "Cumulative Incidence: 21.05 per 1,000 at risk"

```

Why the error happened:

In R, :: allows you to access a function from a package without loading it. However, opts_chunk is not a function; it is a list (specifically an internal object) within the knitr package.

  • Wrong: knitr::opts_chunk_set() (R looks for a function named exactly that and fails).
  • Right: knitr::opts_chunk$set() (R finds the list opts_chunk and then uses the $ to call the set function inside it).