Monday, April 21, 2014

High incidence in Measles Data in Project Tycho

In this third post on Measles data I want to have a look at some high incidence occasions. As described before, the data is from Project Tycho, which contains data from all weekly notifiable
disease reports for the United States dating back to 1888. These data are freely available to anybody interested.

Data

Data reading follows the posting Looking at Measles Data in Project Tycho, part II. In the plot there, some data over 10 seemed to be displayed, which converts to 10 persons per 1000 in a week.r6 <- r5[complete.cases(r5),]r6[r6$incidence>10,] YEAR abb WEEK Cases State pop incidence49841 1939 MT 19 5860 Montana 555 10.5585651076 1939 WY 17 3338 Wyoming 248 13.4596851090 1939 WY 18 2509 Wyoming 248 10.11694
Indeed in 1939 three values are over 10. I have always thought you could only catch measles once, so this suggests a number of years with hardly measles must have occurred before.

Time

To have a decent plot I need a decent time variable.

Quick and dirty

My quick and dirty approach was to add a small fraction for weeks:r6$time <- r6$YEAR+ (r6$WEEK-.5)/with(r6,ave(WEEK,YEAR,State,FUN=max)+1)

Create a date using Formatting

After reading the post Date formating in R I tried a different approach. According to the manual:%UWeek of the year as decimal number (00–53) using Sunday as the first day 1 of the week (and typically with the first Sunday of the year as day 1 of week 1). The US convention.
Unfortunately for me that did not work out for reading data:> as.Date('02 1929',format='%U %Y')[1] "1929-04-20"
20th of April is the day I am running the code, not the second week of 1929. It seems the %U is ignored in the R I compiled.

No comments:

Post a Comment

Wiekvoet

Wiekvoet is about R, JAGS, STAN, and any data I have interest in. Topics range from sensometrics, statistics, chemometrics and biostatistics. For comments or suggestions please email me at wiekvoet at xs4all dot nl.