Today we started doing the analysis of exposures for our outbreak. First we need to create a new variable, as not everyone who is sick meets the case definition for the outbreak.
Case definition Our case definition is someone who has diarrhoea and/or vomiting 24-72 hours after the function. I used the programme editor to define a new variable called Case I made case a Boolean field so the relative risks would calculate correctly (with a Boolean field the Y appears first in a two by two table and then the N and this is what you want to calculate relative risks correctly).
Diarrhoea and Vomit - the fields I needed to create the Case field were also Booklean fields. For a long time I had a problem as I was trying many combinations of If Diarrhoea = Yes or Y or "Y" in my code and it was not working. Then my workmate suggested I try TRUE. I think this is confusing as when you print a Frequency of a boolean Field it prints as Y. Anyway here was the code that worked.
Define case <Y> If Diarrhoea = TRUE or Vomit = TRUE then case = TRUE
This deals with the first part of the case definition - that they must have diarrhoea or vomiting. The next part is that they are NOT a case if the symptoms started on the same day.
The code I ended up using for this was IF onsetdate <= date("24/05/2008") then case = FALSE. I had to put the date function as well as the date itself or the code would not run. I don't know why that is but any other combination I tried like "24/05/2008" or 24/05/2008 or ("24/05/2008") did not work.
Onsetdate In the last post I asked if anyone had some code to create a single onset date from two pieces of information - the vomitdate and the diarrhoea date. My workmate helped me figure out something that worked and this is it.
If diadate < vomdate then onsetdate = diadate If vomdate < diadate then onsetdate = vomdate If vomdate =diadate then onsetdate = diadate If vomdate =(.) then onsetdate = diadate If diadate =(.) then onsetdate = vomdate
Now we have a variables of case and onset date and I created an Epicurv graph using them. It was great. One more frustration. While we were working on the code we often used browse to check our results. We wrote the browse command into the programme editor but the results of the Browse do not appear in the output so I had to do it over again each time in the output screen. I tried list instead of Browse but this didn't work either. Any suggestions for how you can build the output from a browse or line list command into a programme will be welcome.
Next posting we will get on to analysing the exposures
thanks
Christine