# NOT RUN {
data(greece) # Use example surveillance data from Greece
m <- with(greece, fitFluMoDL(deaths = daily$deaths,
temp = daily$temp, dates = daily$date,
proxyH1 = weekly$ILI * weekly$ppH1,
proxyH3 = weekly$ILI * weekly$ppH3,
proxyB = weekly$ILI * weekly$ppB,
yearweek = weekly$yearweek))
m
# Calculate FluMoDL baseline
baseline <- predict(m, temp="MMP", proxyH1=0, proxyH3=0, proxyB=0, byWeek=TRUE)
# Calculate fitted predictions
fitted <- predict(m, byWeek=TRUE)
# }
# NOT RUN {
# Plot everything
plot(with(m$data, tapply(deaths, yearweek, sum)), type="l",
xaxt="n", ylab="Weekly deaths", xlab="Time")
points(baseline, type="l", col="blue")
points(fitted, type="l", col="green")
legend("topleft", c("Actual", "Baseline", "Fitted"), lty="solid",
col=c("black", "blue", "green"), bty="n")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab