Code
## Summarize infection metrics for each iteration
<- summarize_infections(infection) infect_summary
summarize_infections()
summarizes infection metrics by iteration.
View a subset of infect_summary
## Filter data to scenario
infect_summary_select <- infect_summary %>%
filter(region == "central") %>%
filter(scenario_type == "suboptimal") %>%
filter(preclinical == 2)
## Select and order columns to display
infect_summary_select <- infect_summary_select[c("iteration", "farms_infected", "cattle_infected", "first_infect", "last_infect")]
## Check data
head(infect_summary_select)
iteration | farms_infected | cattle_infected | first_infect | last_infect |
---|---|---|---|---|
1 | 82 | 18980 | 10 | 54 |
2 | 13 | 4893 | 10 | 27 |
3 | 179 | 51364 | 10 | 85 |
4 | 10 | 2271 | 10 | 36 |
5 | 20 | 6115 | 10 | 42 |
6 | 116 | 54607 | 10 | 111 |
generate_infect_statistics()
returns summary statistics for each modeling scenario. Results are grouped by region
, scenario_type
, and preclinical
. The output is filtered by summary
and region
to compare farms_infected
and cattle_infected
between scenarios.
The number of infected farms
scenario_type | preclinical | mean | q05 | q25 | q50 | q75 | q95 |
---|---|---|---|---|---|---|---|
optimal | 0 | 7.352 | 2.0 | 2.00 | 3.0 | 6.00 | 20.05 |
optimal | 1 | 12.714 | 2.0 | 3.00 | 5.0 | 11.00 | 56.00 |
optimal | 2 | 23.366 | 2.0 | 4.00 | 9.0 | 22.00 | 94.00 |
optimal | 3 | 72.506 | 3.0 | 7.00 | 15.5 | 67.00 | 372.35 |
suboptimal | 0 | 46.924 | 4.0 | 9.00 | 22.0 | 55.25 | 176.05 |
suboptimal | 1 | 106.394 | 6.0 | 15.00 | 41.0 | 140.25 | 408.15 |
suboptimal | 2 | 250.570 | 7.0 | 24.00 | 81.0 | 369.75 | 939.20 |
suboptimal | 3 | 578.078 | 9.0 | 45.75 | 312.5 | 1008.25 | 1729.50 |
low-virulence | 6 | 3722.938 | 1491.7 | 3034.50 | 3917.0 | 4595.00 | 5520.00 |
scenario_type | preclinical | mean | q05 | q25 | q50 | q75 | q95 |
---|---|---|---|---|---|---|---|
optimal | 0 | 6.564 | 2.00 | 2.00 | 4.0 | 7.00 | 20.05 |
optimal | 1 | 13.590 | 2.00 | 3.00 | 6.0 | 13.00 | 57.05 |
optimal | 2 | 30.400 | 2.00 | 5.00 | 10.0 | 26.00 | 124.05 |
optimal | 3 | 54.782 | 2.00 | 7.00 | 15.0 | 61.25 | 237.10 |
suboptimal | 0 | 41.674 | 4.00 | 10.00 | 21.0 | 51.00 | 134.05 |
suboptimal | 1 | 89.450 | 5.00 | 16.00 | 41.0 | 94.75 | 330.70 |
suboptimal | 2 | 186.164 | 6.00 | 26.00 | 74.0 | 268.25 | 684.10 |
suboptimal | 3 | 457.092 | 9.00 | 43.00 | 250.5 | 655.50 | 1620.15 |
low-virulence | 6 | 3101.590 | 61.85 | 2435.75 | 3412.5 | 4187.25 | 4993.10 |
The total number of cattle on infected farms
scenario_type | preclinical | mean | q05 | q25 | q50 | q75 | q95 |
---|---|---|---|---|---|---|---|
optimal | 0 | 4347.228 | 1627.00 | 1627.00 | 1708.5 | 2899.25 | 13058.80 |
optimal | 1 | 7215.244 | 1627.00 | 1675.75 | 2089.5 | 6008.25 | 30945.40 |
optimal | 2 | 13340.340 | 1627.00 | 1803.50 | 3940.5 | 11030.25 | 51068.45 |
optimal | 3 | 44453.892 | 1651.85 | 2390.25 | 7635.0 | 33766.50 | 233234.75 |
suboptimal | 0 | 25979.990 | 1755.60 | 4074.25 | 11906.5 | 28267.75 | 103639.20 |
suboptimal | 1 | 62846.180 | 1873.15 | 7052.00 | 18708.5 | 72516.75 | 275944.45 |
suboptimal | 2 | 156362.888 | 2106.40 | 10801.75 | 41477.5 | 201033.25 | 666540.50 |
suboptimal | 3 | 455723.392 | 2607.75 | 20374.75 | 167747.5 | 666590.75 | 1930262.85 |
low-virulence | 6 | 3243921.747 | 913215.30 | 2260734.25 | 3449833.0 | 4241386.75 | 5265010.15 |
scenario_type | preclinical | mean | q05 | q25 | q50 | q75 | q95 |
---|---|---|---|---|---|---|---|
optimal | 0 | 2686.652 | 1164.00 | 1164.00 | 1247.0 | 2236.25 | 8903.30 |
optimal | 1 | 5315.418 | 1164.00 | 1208.75 | 1843.0 | 4832.50 | 21955.40 |
optimal | 2 | 11114.532 | 1164.00 | 1355.50 | 2824.0 | 8958.25 | 47171.35 |
optimal | 3 | 17873.322 | 1164.00 | 1766.75 | 4779.0 | 21289.75 | 79301.35 |
suboptimal | 0 | 16142.812 | 1267.80 | 2524.25 | 6678.5 | 18888.50 | 57099.95 |
suboptimal | 1 | 31848.112 | 1453.00 | 4203.00 | 13355.5 | 33844.50 | 126665.70 |
suboptimal | 2 | 62893.166 | 1606.45 | 6739.00 | 23120.0 | 83048.75 | 253791.15 |
suboptimal | 3 | 153263.466 | 1933.45 | 13765.75 | 74901.5 | 215762.00 | 601651.45 |
low-virulence | 6 | 1019390.812 | 14089.10 | 799123.25 | 1161486.0 | 1366618.00 | 1600987.95 |
Perform significance testing on optimal
and suboptimal
detection scenarios.
Call:
lm(formula = log(cattle_infected) ~ preclinical * scenario_type,
data = no_LV_central_summary)
Residuals:
Min 1Q Median 3Q Max
-4.2343 -0.8894 -0.2982 1.0457 4.4918
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.60372 0.04628 185.898 < 2e-16 ***
preclinical1 0.46313 0.06545 7.076 1.75e-12 ***
preclinical2 1.01288 0.06545 15.475 < 2e-16 ***
preclinical3 1.83846 0.06545 28.088 < 2e-16 ***
scenario_type.L 1.08133 0.06545 16.521 < 2e-16 ***
preclinical1:scenario_type.L 0.19539 0.09256 2.111 0.0348 *
preclinical2:scenario_type.L 0.39906 0.09256 4.311 1.66e-05 ***
preclinical3:scenario_type.L 0.59686 0.09256 6.448 1.27e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.464 on 3992 degrees of freedom
Multiple R-squared: 0.4032, Adjusted R-squared: 0.4022
F-statistic: 385.3 on 7 and 3992 DF, p-value: < 2.2e-16
Call:
lm(formula = log(cattle_infected) ~ preclinical * scenario_type,
data = no_LV_eastern_summary)
Residuals:
Min 1Q Median 3Q Max
-3.7779 -0.8537 -0.2152 0.9186 4.4417
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.21104 0.04188 196.060 < 2e-16 ***
preclinical1 0.47570 0.05923 8.032 1.25e-15 ***
preclinical2 0.95705 0.05923 16.159 < 2e-16 ***
preclinical3 1.59329 0.05923 26.901 < 2e-16 ***
scenario_type.L 0.99160 0.05923 16.742 < 2e-16 ***
preclinical1:scenario_type.L 0.10213 0.08376 1.219 0.22280
preclinical2:scenario_type.L 0.21745 0.08376 2.596 0.00947 **
preclinical3:scenario_type.L 0.46956 0.08376 5.606 2.21e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.324 on 3992 degrees of freedom
Multiple R-squared: 0.3794, Adjusted R-squared: 0.3783
F-statistic: 348.6 on 7 and 3992 DF, p-value: < 2.2e-16
plot_infected_cattle()
returns a plot with the duration of incubation phase transmission on the x-axis and the median number of infected cattle (log10) on the y-axis.