Task 1c: How to Save NHANES Datasets in Stata

Here are the steps to save an NHANES dataset in Stata:


Step 1: Save as permanent dataset

In this step, you will save the dataset demo _BP4.dta currently in memory to a permanent dataset, called BP_analysis_data.dta. This permanent dataset will be saved in the folder C:\NHANES\DATA which was created in the Download Data Files module. Please note that if your files have different names you must change the Stata code provided on the Download Programs & Datasets page accordingly.

Save filename [, save_options]

use "C:\NHANES\DATA\ demo_BP4.dta"
save "C:\NHANES\DATA\BP_analysis_Data"


Step 2: Check that dataset was saved to a directory

To check that your dataset was saved to the C:\NHANES\DATA directory:

  1. Open the Windows Explorer.
  2. When the Explorer opens, follow the path to C:\NHANES\DATA.
  3. The contents of C:\NHANES\DATA should contain the dataset, BP_analysis_data.dta


close window icon Close Window