Skip directly to local search Skip directly to A to Z list Skip directly to navigation Skip directly to site content Skip directly to page options
CDC Home

Injury Data and Resources

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

STATA Programs for Identifying Injury Records

 

The following "Do" files  run STATA statements that will identify which NHAMCS emergency department records were for 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. In 2005, the way in which this field was derived changed due to a change in fields on the record. The first do-file is for using data from 2005 and the second do-file is for data from 2002-2004.

 

*DO-FILE FOR USING DATA FROM 2005

 

*Replace c:\nhamcs\ed with the directory containing your dataset
Cd “c:\nhamcs\ed”


*Replace ed with the name of your dataset
use "ed.dta", clear
*Create variables to use in deriving the injury indicator
gen causedet=strofreal(cause13d)
gen diag14d=substr(diag1,1,4)
gen diag15d=diag1

 

*Determine if record has an external cause of injury
gen EXTINJ=0

replace EXTINJ=1 if (causedet >= "800" & causedet <= "869")
replace EXTINJ=1 if (causedet >= "880" & causedet <= "929")
replace EXTINJ=1 if (causedet >= "950" & causedet <= "999")
replace EXTINJ=2 if (causedet >= "870" & causedet <= "879")
replace EXTINJ=2 if (causedet >= "930" & causedet <= "949")

 

*Determine if the first listed diagnosis on the record is for injury
gen NEWINJ=0

replace NEWINJ=1 if (diag14d >= "8000" & diag14d <= "9092")
replace NEWINJ=1 if (diag14d == "9094" )
replace NEWINJ=1 if (diag14d >= "9099" & diag14d <= "9949")
replace NEWINJ=1 if (diag15d >= "99550" & diag15d <= "99559")
replace NEWINJ=1 if (diag15d >= "99580" & diag15d <= "99585")
replace NEWINJ=2 if (diag13d < "800" | diag13d > "999")

 

*Determine if the record should be considered an injury record
gen INJSPB=0

replace INJSPB=1 if (initvis==1 & (NEWINJ==1 & EXTINJ==1))
replace INJSPB=1 if (initvis ==1 & (NEWINJ==1 & EXTINJ==0))
replace INJSPB=1 if (initvis ==1 & (NEWINJ==2 & EXTINJ==1))

 

*Run frequency of injuries weighting data with patwt
tab INJSPB [weight=patwt]

 

*DO-FILE FOR USING DATA FROM 2002-2004

 

*Replace c:\nhamcs\ed with the directory containing your dataset
Cd “c:\nhamcs\ed”

*Replace ed with the name of your dataset
use "ed.dta", clear

*Create variables to use in deriving the injury indicator
gen causedet=strofreal(cause13d)
gen diag14d=substr(diag1,1,4)
gen diag15d=diag1

 

*Determine if record has an external cause of injury
gen EXTINJ=0

replace EXTINJ=1 if (causedet >= "800" & causedet <= "869")
replace EXTINJ=1 if (causedet >= "880" & causedet <= "929")
replace EXTINJ=1 if (causedet >= "950" & causedet <= "999")
replace EXTINJ=2 if (causedet >= "870" & causedet <= "879")
replace EXTINJ=2 if (causedet >= "930" & causedet <= "949")

 

*Determine if the first listed diagnosis on the record is for injury
gen NEWINJ=0

replace NEWINJ=1 if (diag14d >= "8000" & diag14d <= "9092")
replace NEWINJ=1 if (diag14d == "9094" )
replace NEWINJ=1 if (diag14d >= "9099" & diag14d <= "9949")
replace NEWINJ=1 if (diag15d >= "99550" & diag15d <= "99559")
replace NEWINJ=1 if (diag15d >= "99580" & diag15d <= "99585")
replace NEWINJ=2 if (diag13d < "800" | diag13d > "999")

 

*Determine if the record should be considered an injury record
gen INJSPB=0

replace INJSPB=1 if (episode==1 & (NEWINJ==1 & EXTINJ==1))
replace INJSPB=1 if (episode==1 & (NEWINJ==1 & EXTINJ==0))
replace INJSPB=1 if (episode==1 & (NEWINJ==2 & EXTINJ==1))

 

*Run frequency of injuries weighting data with patwt
tab INJSPB [weight=patwt]

 

 

 

Injury Data
Contact Us:
  • Office of Analysis and Epidemiology
    National Center for Health Statistics
    3311 Toledo Rd
    Hyattsville, MD 20782
  • 1 (800) 232-4636
  • nchsinjury@cdc.gov
USA.gov: The U.S. Government's Official Web PortalDepartment of Health and Human Services
Centers for Disease Control and Prevention   1600 Clifton Rd. Atlanta, GA 30333, USA
800-CDC-INFO (800-232-4636) TTY: (888) 232-6348 - Contact CDC–INFO
A-Z Index
  1. A
  2. B
  3. C
  4. D
  5. E
  6. F
  7. G
  8. H
  9. I
  10. J
  11. K
  12. L
  13. M
  14. N
  15. O
  16. P
  17. Q
  18. R
  19. S
  20. T
  21. U
  22. V
  23. W
  24. X
  25. Y
  26. Z
  27. #