# Presentation: 536573

##  Understanding and Using NAMCS and NHAMCS Data:

**A Hands-On Workshop**
**Part II-Using Raw Data Files**
**Donald Cherry**

## Session Goals

- A the end of this session I would like you to:
- Be able to successfully download data files and create a SAS dataset for analysis
- Understand some of the limitations and advantages of using NAMCS/NHAMCS downloadable data
- Perform simple analyses

## Using raw data files

- File structure
- Exercises using SUDAAN & SAS Proc Surveymeans
- Downloading data & creating a SAS dataset
- Simple frequencies with/without standard errors
- Creating a new variable-Asthma
- Visit rates-male/female
- Total number of drug mentions
- Antidepressant drug mentions
- Time spent with physician
- Trend considerations
- Other issues--multiple years/settings
- Summary

## File Structure

- Download data and layout from website
- 	_http://www.cdc.gov/nchs/about/major/ahcd/ahcd1.htm_
- Flat ASCII files for each setting and year
- NAMCS: 1973-2002
- NHAMCS: 1992-2002

**Notes:**
1)3 pieces of info:  actual data, documentation (description of survey, coding, variable names & location on flat file), & actual SAS statements (SAS Input StatementsSAS Variable Labels and Format Assignments, & SAS Value Labels) 
NAMCS: 1993-2002
NHAMCS: 1995-2002

3)Initial release of the 2000-2002 public-use files includes masked sample design variables. We re-released the 1993-99 NAMCS and 1995-99 NHAMCS files to include these variables. For re-released files, file names and layouts are essentially the same, but the design variables have been appended to each file according to a generic file layout that is available for downloading below.  4)Remember: For data years 1993-99, be sure to download not only the original file documentation for each year, but also the supplemental files that explain the new sample design variables that have been added to each file. The supplemental files also include descriptions of any revisions that may have been made to the original data files. 5)

## Structure organization

**Notes:**
Provider information:  MD vs. DO, Specialty, 
Practice information:  type of office setting, solo vs. non-solo, employment status of physician, ownership of practice, lab testing
Geographic info:  region of country, MSA vs. non-MSA  

## 
Double-click:  My Computer\Local Disk C:\DUC_04

Double-click: SAS file: Exercises

- Double-click:  My Computer\Local Disk C:\DUC_04
- Double-click: SAS file: Exercises

**Hands-on Exercises**

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

## SAS version 9.1 example

- tables sex*ager;
- strata cstratm;
- cluster cpsum;
- weight patwt2;
**run**;

**Notes:**
1)This procedure is available in SAS 9.1 which is out now.

## Slide 8

## Visit estimates

| Phycode | Sex | Patwt | (Patwt/Pop)*100 | Sexwt |
| --- | --- | --- | --- | --- |
| 1401 | 1 | 100 | (100/800)*100 | 12.5 |
| 1522 | 1 | 300 | (300/800)*100 | 37.5 |
| 1001 | 1 | 50 | (50/800)*100 | 6.25 |
| 500 | 1 | 120 | (120/800)*100 | 15 |
|  |  |  |  | 71.25 |

- Female population=800

- New variable

- Calculation*

- *Note:  Rate=est/pop=Σ patwt/pop=1/pop*Σ patwt.

## Arrays

| Phycode | Patcode | Med1 | Med2 | Med3 | Med4 | Med5 | Med6 | Total |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1431 | 1 | 32905 | 90000 | 90000 | 90000 | 90000 | 90000 | 1 |
| 1431 | 2 | 95005 | 02995 | 90000 | 90000 | 90000 | 90000 | 2 |
| 1431 | 3 | 26740 | 90000 | 90000 | 90000 | 90000 | 90000 | 1 |
| 1431 | 4 | 90000 | 90000 | 90000 | 90000 | 90000 | 90000 | 0 |
| 1431 | 5 | 21228 | 35465 | 40295 | 90000 | 90000 | 90000 | 3 |

- Note:  90000=No mention.

- Total drug mentions:  7

## Some considerations:  SUDAAN vs. SAS Proc Surveymeans

| SUDAAN | PROC Surveymeans |
| --- | --- |
| •design variables=cstratm, cpsum (1-stage design) | •design variables=cstratm, cpsum (1-stage design)
 |
| •nest=cstratm, cpsum | •strata cstratm 
•cluster cpsum |
| •Sort by design variables | •Sort not needed |
| •Weight data: Patwt2 | •Weight data: Patwt2 |
| •Subgroup=identify                  categorical  variables | •Class=identify categorical variables |
| •Tables=analysis variables | •Var=analysis variables |

**Notes:**
1)Secify differences—Proc Surveymeans cannot to get Total %’s for crossed variables

## Trend considerations

- Variables routinely rotate on and off survey
- Be careful about trending diagnosis prior to 1979 because of  ICDA (based on ICD-8)
- Even after 1980- be careful about changes in
- 	ICD-9-CM
- Number of medications varies over years
- 			**1980-81 – 8 medications**
**	****	****	****1985, 1989-94 – 5 medications**
**	****	****	****1995-2002 – 6 medications**
**	****	****	****2003+8 – medications**
- Diagnostic & therapeutic checkboxes vary
- Use spreadsheet for significance of trends

## Combining multiple years

- 2 year combinations are best for subpopulation analysis
- 3-4 year combinations for disease specific analysis
- Keep adding years until you have at least 30 raw cases in important cells
- RSE improves incrementally with the number of years combined

## RSE improves incrementally with the number of years combined

- RSE = SE/*x*
- RSE for percent of visits by persons less than 21 years of age with diabetes
- 1999  RSE = .08/.18 = .44 (44%)
- 1998 & 1999 RSE = .06/.18 = .33 (33%)
- 1998, 1999, & 2000 RSE = .05/.21 = .24 (24%)

## NAMCS, ED, and OPD can be combined in one or multiple years
NAMCS & OPD variables virtually identical, many ED variables are same

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

Only NAMCS has physician specialty

- NAMCS & OPD variables virtually identical, many ED variables are same
- OPD and NAMCS should be combined to get estimates of ambulatory physician care especially for African-American, Medicaid or adolescent subpopulations
- Only NAMCS has physician specialty

**Combining multiple settings**

## Design Variables—Survey Years

- 2001*

- 3- & 4-Stage
- design variables

- 2003

- 2002

- 1-Stage design
- variables only

- 1-Stage design
- variables
- 3- & 4-Stage design
- variables

**Design Variables—Survey Years**

- *Plan to re-release years with 1-stage design variables.

## Code to create design variables: survey years 2001 & earlier

- 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);

## If nothing else, remember...The Public Use Data File Documentation is YOUR FRIEND!

- Each booklet includes:
- A description of the survey
- Record format
- Marginal data (summaries)
- Various definitions
- Reason for Visit classification codes
- Medication & generic names
- Therapeutic classes

## Where to get more information?

- _[www.cdc.gov/nchs/about/major/ahcd1.htm](http://interdev2.nchs.cdc.gov/nchs/)_
- Call Ambulatory Care Statistics Branch at 301-458-4600