# Presentation: 737229

## Understanding and Using NAMCS and NHAMCS Data

**Part 2 –****Using public-use files**
**Eric Nawar**
**Ambulatory Care Statistics Branch**
**Division of Health Care Statistics**

## Overview

- - **For each program (SAS, Stata, SUDAAN):**
- Review public use files
- Create dataset
- Run exercises

**- Other notes/considerations:**
- Combining multiple years of data
- Multiple settings

- - **Notes on exercises:**
- Calculating rates
- Calculating drug mentions
- Procedures used

## Calculating Rates

- Example: Visits per 100 persons
- Method: Create a new weight
**totrt = (patwt/total population) * 100**
- Example: Visits per 100 persons (for each sex)
**if sex=female then **
**	****sexwt=(patwt/female pop) * 100**
**else if sex=male then **
**	****sexwt=(patwt/male pop) * 100  etc.**

## Calculating Drug Mentions

| Record | Med1 | Med2 | Med3 | Med4 | Med5 | Med6 | Med 7 | Med 8 | Total |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | 32905 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 1 |
| 2 | 95005 | 02995 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 2 |
| 3 | 26740 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 1 |
| 4 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 0 |
| 5 | 21228 | 35465 | 40295 | 90000 | 90000 | 90000 | 90000 | 90000 | 3 |

- Note:  90000=No drug mention.

**Calculating Drug Mentions**

## Calculating Drug Mentions, cont.Method: Use an array to sum the number mentions in each record

**total=0;**
**array meds(8) med1-med8;**
**do j=1 to 8;**
**	****if meds(j) ne '90000' then ****	****total=total+1; **
**end;**

## Calculating Drug Mentions, cont.

- Medications: Up to 8  ... **j=1 to 8**
- Drug class: 8 meds * 3 classes ... **j=1 to 24**
- Drug ingredients: 8 meds * 5 ing ... **j=1 to 40**
- Another example:
- X-rays: chest, extremity, other ... **j=1 to 3**

## Procedures

| Program | Categorical Variables | Continuous Variables |
| --- | --- | --- |
| SAS | PROC SURVEYFREQ | PROC SURVEYMEANS |
| STATA | SVY: TAB | SVY: MEAN |
| SUDAAN | PROC CROSSTAB | PROC DESCRIPT |

## 
C:\NAMCS\DUC\

**C:\NAMCS\DUC\**

**Hands-on Exercises**

**Notes:**
1)Mean=percent for categorical variables
2)Standard deviation=standard error of estimate

## Combining Multiple Years of Data

- Variables: sometimes rotate on and off survey
- Annual estimate: divide estimate by the number of years
- Weighting:
- Beginning in 2004, calendar quarter was used in nonresponce adjustments.  Change in weight did not significantly alter estimates.
- Beginning in 2003, the number of weekly visits and the number of weeks in the year the physicians saw patients was also used.
- *****New weight increased visit estimation by 12% (therefore old weight not comparable to new – see 2003 NAMCS ADR for more info)
- ICD codes: currently using ICD-9-CM, prior to 1979 used ICDA (based on ICD-8)

- Need to consider changes to the survey over the years:

## Combining Multiple Years of Data (cont.)

- 	Design variables: beginning in 2003, multi stage design variables that were available in prior years were changed to single stage (ultimate cluster design).

- Code to create ultimate cluster design variables (for each year prior to 2002):
- CPSUM=PSUM;
- CSTRATM = STRATM;
- IF CPSUM IN(1, 2, 3, 4) THEN DO;
- CPSUM = PROVIDER +100000;
- CSTRATM = (STRATM*100000) +(1000*(MOD(YEAR,100))) + (SUBFILE*100) + PROSTRAT;
- END;
- ELSE CSTRATM = (STRATM*100000);

## NAMCS, ED, and OPD can be combined in one or multiple years:
	SETTYPE=1 (NAMCS), 2 (ED), or 3 (OPD)

OPD and NAMCS should be combined to get estimates of ambulatory physician care especially for African-American, Medicaid or adolescent subpopulations

ED and OPD were sampled together and should therefore be combined initially (can “subpop” the setting of interest afterwards)

Only NAMCS has physician specialty

- 	SETTYPE=1 (NAMCS), 2 (ED), or 3 (OPD)
- OPD and NAMCS should be combined to get estimates of ambulatory physician care especially for African-American, Medicaid or adolescent subpopulations
- ED and OPD were sampled together and should therefore be combined initially (can “subpop” the setting of interest afterwards)
- Only NAMCS has physician specialty

**Combining multiple settings**

## Where to get more information?

- Public Use Documentation:
- A description of the survey
- Record format
- Marginal data (summaries)
- Various definitions
- Reason for Visit classification codes
- Medication & generic names
- Therapeutic classes
- _[www.cdc.gov/nchs/namcs.htm](http://www.cdc.gov/nchs/namcs.htm)_
- 	_[www.cdc.gov/nchs/nhamcs.htm](http://www.cdc.gov/nchs/nhamcs.htm)_
- Eric Nawar--enawar@cdc.gov
- Call Ambulatory Care Statistics Branch at 301-458-4600