Ad Hoc Analysis

The purpose of the Ad Hoc Analysis Helper is to provide sample code that can be used in Analysis to gather data for commonly used purposes, formulas, etc. Select a topic for more information

Time interval selection

Month-Year MM_YYYY variable

Case classification status

Age and age group variable

Vaccination status variable

Other variables

Time interval selection

To analyze data between two dates, copy and paste the following code below into the EpiInfo Analysis module programming window. Then change the beginning date from 01/01/2000 and the ending date of 31/12/20004 to your desired beginning and ending dates. The dates are in European format.

SELECT DateOfonset>=01/01/2000AND DateOfonset<=31/12/20004

DateOfonset is the variable name for date of onset field in the measles.mdb

Month-Year MM_YYYY variable

To do an adhoc time trend graph that crosses more than one year, one can copy the code below and paste into the EpiInfo Analysis module programming window. It will produce a Month_Year variable. You can do a freq or table using the Month_Year variable and paste the result into Excel or you can use the EpiInfo Graph command to make a graph.

.

Case classification status

Case classification status

We list examples of analyses using the case classification status:

Only laboratory - confirmed cases: SELECT FINALCLASSIFICATION = XXXX Confirmed by lab or epi-link: SELECT FINALCLASSIFICATION = XXXX Total confirmed (Lab, epi-link, clinical/compatible): SELECT FINALCLASSIFICATION = XXXX Clinical/compatible only: SELECT FINALCLASSIFICATION = XXXX

Missing+pending classification status: SELECT FINALCLASSIFICATION = XXXX

.

.

Age and age group variable

To do an adhoc analysis using age, one can copy the code below and paste into the EpiInfo Analysis module programming window.

XXXXXXX

Vaccination status variable

To do an adhoc analysis using vaccination status, one can copy the code below and paste into the EpiInfo Analysis module programming window.

XXXXXXX

Year/Month/Day Code

Use the following snippets of code to help determine the year, month, day, or calendar date.

Determine the Year

This piece of code returns the Year within the Date of Onset field.

DEFINE Year

ASSIGN Year=Year(DONSET)

Determine the Month

This piece of code returns the Month within the Date of Onset field.

DEFINE Month

ASSIGN Month=Month(DONSET)

Determine the Day

This piece of code returns the Day within the Date of Onset field.

DEFINE DAY

ASSIGN DAY=DAY(DONSET)

Determine the Calendar Date

This piece of code converts the numeric value in the Date of Onset field and returns the value in a yyyy/mm/dd format.

DEFINE CALCDATE

CALCDATE=NUMTODATE(YEAR,MONTH,DAY)

Select Records with Any Data

When looking through data, there are times where blanks in specific fields may be present. To view data without displaying the records where a specific field is blank, you will use the NOT operator. The syntax for the NOT operator follows:

[NOT variable = (.)]

Example using the NOT operator

This piece of code states that if DOB is not blank, then define age as the number of days between date of birth and date of onset divided by 365.

DEFINE AGE

If NOT DOB=(.) Then

age=(DAYS(DOB, DONSET))/365

End