Learn R Programming

rgam (version 0.6.6)

ili.visits: Influenza-like-illness outpatient visits.

Description

These data contain the number of reported influenza-like-illness outpatient visits in the US for the 2006, 2007 and 2008 seasons. A season consists of weeks 40 to week 20 of the following year, so that, for example, the 2008 season includes up to week 20 of 2009, where the H1N1 flu epidemic had already caused a noticeable increase in ILI visits.

Usage

ili.visits

Arguments

Format

A data frame with 99 observations on the following 3 variables.

visits

the number of reported ILI visits for that week (numeric)

season

the season year (numeric)

week

the week number for that season (numeric)

Examples

Run this code
# NOT RUN {
library(rgam)
plot(visits ~ week, data=ili.visits, xlab='Week', ylab='ILI visits',
pch=19, col='grey75')
with(ili.visits, {
  a <- rgam(x=week, y=visits, family='poisson', cv.method='rcv',
            epsilon=1e-7, alpha=17/80, max.it=500)
  pr.rgam <- predict(a, type='response')
  lines(week[order(week)], pr.rgam[order(week)], lwd=3, col='red')
})
# }

Run the code above in your browser using DataLab