CDC en Español

National Center for Health Statistics  Monitoring the Nation's Health

Injury Data and Resources

  • Email this page

Injury Data LogoInstructions:  Step-by-Step Guide to Accessing NHAMCS-ED Public Use Data Files and Programs to Select Injury Records and Calculate Rates

 

SAS Statements for Identifying Injury Records in NHAMCS-ED

The following SAS statements run in a SAS data step and identify which NHAMCS emergency department records were injuries based on the NCHS Injury Team’s definition of injury (See Recommended definition of initial injury visits to emergency departments for use with the NHAMCS-ED data, available on the injury website, for more information.) The injury indicator field is called INJSPB. Records with "INJSPB=1" are injury records. In 2005, the way in which this field was derived changed due to a change in fields on the record. The data prior to 2001 do not include a variable to determine whether the visit was an initial one or not. Definition of an injury record beginning in 2001 includes initial visit status.

SAS statements for 2005-06

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
INITVIS is an imputed variable to indicate initial visit for problem
INITVIS=1 indicates initial visit*/

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);
 
/*defining external cause of injury*/
 
EXTINJ=0;
IF '800'<=CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;
 
/*defining first listed injury diagnosis*/
 
NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR ('99550'<=DX15<='99559')
OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;
 
/*defining injury records */
 
INJSPB=0;
IF INITVIS =1 AND ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1)) THEN INJSPB=1;

SAS Statements for 2001-04

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
EPISODE is the variable for "Episode of care"
EPISODE=1 indicates initial visit */

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);
 
/*defining external cause of injury*/
 
EXTINJ=0;
IF '800'<=CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;
 
/*defining first listed injury diagnosis*/
 
NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR ('99550'<=DX15<='99559')
OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;
 
/*defining injury records */
 
INJSPB=0;
IF EPISODE =1 AND ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1)) THEN INJSPB=1;

SAS statements for 1995-2000

/*CAUSE1 and DIAG1 are variable names used in our SAS input statement.
CAUSE1 is the variable for "Cause of injury #1"
DIAG1 is the variable for "Physician's diagnosis #1"
Variable "Episode" not available prior to 2001*/

CAUSEDET=substr(left(CAUSE1),1,3);
DX13=substr(left(DIAG1),1,3);
DX14=substr(left(DIAG1),1,4);
DX15=substr(left(DIAG1),1,5);
 
/*defining external cause of injury*/
 
EXTINJ=0;
IF '800'<=CAUSEDET<='869' OR '880'<=CAUSEDET<='929' OR '950'<=CAUSEDET<='999' THEN EXTINJ=1;
IF ('870'<=CAUSEDET<='879') OR ('930'<=CAUSEDET<='949') THEN EXTINJ=2;
 
/*defining first listed injury diagnosis*/
 
NEWINJ=0;
IF ('8000'<= DX14<='9092') OR DX14='9094' OR ('9099'<=DX14<='9949') OR DX14='9955'
OR ('99580'<=DX15<='99585') THEN NEWINJ=1;
IF DX13 < '800' or DX13 >'999' THEN NEWINJ=2;
 
/*defining injury records */
 
INJSPB=0;
IF ((NEWINJ=1 AND (EXTINJ = 1 OR EXTINJ=0)) OR (NEWINJ=2 AND EXTINJ=1)) THEN INJSPB=1;

 

Page Last Modified: September 26, 2008

Our Links

What's New

Quick Links

Related Links

Contact Injury

Special Projects Branch
Office of Analysis and Epidemiology
NCHS, Centers for Disease Control and Prevention
Mailstop P08
nchsinjury@cdc.gov

National Center for Health Statistics
3311 Toledo Road
Hyattsville, MD 20782
Phone: 1-800-232-4636
nchsquery@cdc.gov

Safer Healthier People

Centers for Disease Control and Prevention, 1600 Clifton Rd, Atlanta, GA 30333, U.S.A
Tel: (404) 639-3311 / Public Inquiries: (404) 639-3534 / (800) 311-3435