This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

  1. Rabies

Reproductive number of rabies among dogs in Kenya is 2.44

Ro = 2.44

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 2.44 2.196 1.952 1.708 1.464 1.22 0.976 0.732 0.488 0.244 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.5901639

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Rabies", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. Measles

Reproductive number of Measles is 14

Ro = 14

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 14 12.6 11.2 9.8 8.4 7 5.6 4.2 2.8 1.4 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.9285714

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Measles", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. Pertussis

Reproductive number of Pertussis is 16

Ro = 16

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 16 14.4 12.8 11.2 9.6 8 6.4 4.8 3.2 1.6 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.9375

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Pertussis", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. chicken pox

Reproductive number of Chicken pox is 10

Ro = 10

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 10 9 8 7 6 5 4 3 2 1 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.9

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Chicken pox", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. Mumps

Reproductive number of Mumps is 12

Ro = 12

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 12 10.8 9.6 8.4 7.2 6 4.8 3.6 2.4 1.2 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.9166667

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Mumps", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. Rubella

Reproductive number of Rubella is 7

Ro = 7

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 7 6.3 5.6 4.9 4.2 3.5 2.8 2.1 1.4 0.7 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.8571429

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Rubella", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")

  1. Polio

Reproductive number of Measles is 6

Ro = 6

Generate sequence of numbers for fraction of population vaccinated from 0 to 1 with 0.1 interval.

fraction_vaccinated = seq (0, 1, 0.1)

Print fraction of population vaccinated.

cat ("Fraction of population vaccinated: ", fraction_vaccinated)
## Fraction of population vaccinated:  0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Compute effective reproductive number

Re = Ro * (1 - fraction_vaccinated)

Print effective reproductive number.

cat ("Effective reproductive number:", Re)
## Effective reproductive number: 6 5.4 4.8 4.2 3.6 3 2.4 1.8 1.2 0.6 0

Compute herd immunity threshold.

herd_immunity_threshold = 1 - (1/Ro)

Print herd immunity threshold.

cat ("herd immunity threshold = ", herd_immunity_threshold)
## herd immunity threshold =  0.8333333

Plot fraction of population vaccinated (versus) effective reproductive number.

subtitle = paste("Ro = ", Ro, ", Herd Immunity Threshold = ", round(herd_immunity_threshold, digits = 4) , sep="")

plot (fraction_vaccinated, Re, main = "Polio", sub = subtitle, xlab = "Fraction of population vaccinated", ylab = "Effective reproductive number (Re)")