hidden biases using sas dates n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Hidden Biases Using SAS Dates PowerPoint Presentation
Download Presentation
Hidden Biases Using SAS Dates

Loading in 2 Seconds...

play fullscreen
1 / 20

Hidden Biases Using SAS Dates - PowerPoint PPT Presentation


  • 173 Views
  • Uploaded on

Hidden Biases Using SAS Dates. Steve James. Information Specialist GASUG Meeting February 1, 2012. National Center for Immunization & Respiratory Diseases. Informatics Office. Hidden Biases Using SAS Dates Summary.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Hidden Biases Using SAS Dates' - leverett


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
hidden biases using sas dates
Hidden Biases Using SAS Dates

Steve James

Information Specialist

GASUG MeetingFebruary 1, 2012

National Center for Immunization & Respiratory Diseases

Informatics Office

hidden biases using sas dates summary
Hidden Biases Using SAS DatesSummary
  • Just because SAS stores its dates as numbers doesn’t solve all of your problems with dates.
    • There can be a hidden bias with dates when using units such as months and years.
  • How you calculate age can introduce a bias.
hidden biases using sas dates introduction
Hidden Biases Using SAS DatesIntroduction
  • CDC is developing a system to analyze patient-level Immunization data collected by State Health Departments.
    • Whether a dose of a vaccine is valid is a critical piece of information for analyzing the data.
  • A key component of dose validation is the age a patient receives a vaccination.
hidden biases using sas dates introduction1
Hidden Biases Using SAS DatesIntroduction
  • The Advisory Committee for Immunization Practices (ACIP) determines the guidelines for minimum age of each vaccine.
    • For example, the minimum age for the Influenza (Flu) vaccine is 6 months.
    • There is a 4-day grace period associated with all minimum age and minimum intervals.
initial design discussions
Initial Design Discussions
  • How many days are in a year?
  • “SAS knows how to handle dates.”
sas pseudo code
SAS Pseudo-Code
  • Minimum Age for Influenza (Flu) Vaccine is 6 months
  • IF VaccinationDate – DOB ge 6 months then valid = 1 ; else valid = 0 ;
how many days are in 6 months
How Many Days Are In 6 Months?
  • 180?
  • 181?
  • 184?
  • It depends?
it depends
It Depends?
  • January 1 to July 1 2012 has 182 days.
  • March 1 to September 1, 2012 has 184.
  • June 1 to December 1, 2012 has 183.
  • September 1, 2012 to March 1 2013 has 181.
hockey and birthdate bias
Hockey and Birthdate Bias
  • Malcolm Gladwell in his book Outliers describes how some elite Canadian hockey teams have a disproportionate number of players born in the first half of the year.
  • How children were selected for youth hockey introduced a bias.
  • Children born soon after the cutoff date had an advantage over those born later in the year.
problem
Problem
  • There’s not a foolproof way to convert months and years into a certain number of days.
  • Any attempt to try to force it will cause some doses to be valid when they shouldn’t be and some not to be valid when they should be.
  • This is a bias that might be easily overlooked in testing.
how do we solve this
How Do We Solve This?
  • MinAgeUnit=‘Months’ ;
  • MinAgeValue=6 ;If MinAgeUnit = ‘Months’ then do ; if AgeInMonths< MinAgeValue then Valid = ‘No’ ; else Valid = ‘Yes’ ;
brute force
Brute Force

If MinAgeUnit = ‘Years’ then do ; if AgeInYears < MinAgeValue then Valid = ‘No’ ; else Valid = ‘Yes’ ;If MinAgeUnit = ‘Weeks’ then do ; if AgeInWeeks< MinAgeValue then Valid = ‘No’ ; else Valid = ‘Yes’ ;If MinAgeUnit = ‘Days’ then do ; if AgeInDays< MinAgeValue then Valid = ‘No’ ; else Valid = ‘Yes’ ;

using arrays
Using Arrays
  • Array Ages(*) AgeInYearsAgeInMonthsAgeInWeeksAgeInDays;if MinAgeUnit=‘Years’ then index=1;else if MinAgeUnit=‘Months’ then index=2 ;else if MinAgeUnit=‘Weeks’ then index=3 ;else if MinAgeUnit=‘Days then index=4 ;if Ages(index) < MinAgeValue then valid=‘No’ ; else valid=‘Yes’ ;
calculate date minimum age is reached
Calculate Date Minimum Age is Reached
  • MinAgeDate = INTNX(MinAgeUnit, DOB, MinAgeValue,‘sameday’) - GracePeriod ;If VaccinationDate < MinAgeDate then valid = ‘No’ ; else valid = ‘Yes’ ;
intnx function
INTNX Function
  • Returns a SAS date value incremented by a specific number of intervals.
  • SAMEDAY option available in SAS 9 preserves the alignment of the date within the interval before its incremented.
calculating age in years
Calculating Age in Years
  • Age = INT((SomeDate – DOB) / 365.25 ) ;Off by 1for dates exactly on anniversary. E.G. 01/01/2011 – 01/01/2010 = 365 Int (365/365.25) = 0
calculating age in years1
Calculating Age in Years
  • INT (( INTCK(‘month’, DOB,SomeDate) - (DAY(DOB) > DAY(SomeDate))) /12 ) ;This calculates the number of months between two dates and divides that number by 12.
  • (DAY(DOB) > DAY(SomeDate)) adjusts for those cases when a whole month hasn’t been completed.
summary
Summary
  • Just because SAS stores its dates as numbers doesn’t solve all of your problems with dates.
    • There can be a hidden bias with dates when using units such as months and years.
  • How you calculate age can introduce a bias.
steve james spj1@cdc gov 404 639 6041
Steve Jamesspj1@cdc.gov404-639-6041

For more information please contact Centers for Disease Control and Prevention

1600 Clifton Road NE, Atlanta, GA 30333

Telephone: 404-639-6041

E-mail: spj1@cdc.gov Web: http://www.cdc.gov

The findings and conclusions in this report are those of the authors and do not necessarily represent the official position of the Centers for Disease Control and Prevention.

National Center for Immunization & Respiratory Diseases