log using adultinc.log, replace /* ---------------------------------------------------------------------------- The National Health Interview Survey (NHIS) 2020; Sample Adult Imputed Income data file This program loads the NHIS sample adult imputed income ASCII data file downloaded from the NCHS website (https://www.cdc.gov/nchs/nhis/index.htm) to a Stata dataset. The program creates descriptive variable labels and formats with meaningful category labels. It sets the variable lengths and uses input statements to read in the data. BEFORE RUNNING THIS PROGRAM, PLEASE: - Create a folder called C:\NHIS2020 (on a machine running Windows) - Download the sample adult imputed income ASCII file to the folder C:\NHIS2020 (on a machine running Windows) Running this program will replace the log file and the dataset in the default directory, if present. */ cd c:\nhis2020 version 6.0 * The following command temporarily changes the command- * ending delimiter from a carriage return to a semicolon #delimit; clear; set mem 200m; * INPUT ALL VARIABLES; infix /* IDN LOCATIONS */ rectype 1 - 2 str hhx 3 - 9 impnum 10 - 11 /* INC LOCATIONS */ faminctc_a 12 - 17 povrattc_a 18 - 22 incgrp_a 23 - 23 ratcat_a 24 - 25 str impincflg_a 26 - 30 inctcflg_a 31 - 31 using adultinc20.dat; * DEFINE VARIABLE LABELS; * IDN VARIABLE LABELS; label variable rectype "Record type"; label variable hhx "Randomly assigned household number unique to a household"; label variable impnum "Imputation number"; * INC VARIABLE LABELS; label variable faminctc_a "Sample adult family income (top-coded)"; label variable povrattc_a "SA family poverty ratio (top-coded)"; label variable incgrp_a "Sample adult family income (grouped)"; label variable ratcat_a "Ratio of family income to poverty threshold for SA's family"; label variable impincflg_a "Imputed SA family income imputation flag"; label variable inctcflg_a "Sample adult family income top-code flag"; * DEFINE VALUE LABELS FOR REPORTS; label define AI001X 1 "$0 to $34,999" 2 "$35,000 to $49,999" 3 "$50,000 to $74,999" 4 "$75,000 to $99,999" 5 "$100,000 or greater" 8 "Not Ascertained" ; label define AI002X 01 "0.00 - 0.49" 02 "0.50 - 0.74" 03 "0.75 - 0.99" 04 "1.00 - 1.24" 05 "1.25 - 1.49" 06 "1.50 - 1.74" 07 "1.75 - 1.99" 08 "2.00 - 2.49" 09 "2.50 - 2.99" 10 "3.00 - 3.49" 11 "3.50 - 3.99" 12 "4.00 - 4.49" 13 "4.50 - 4.99" 14 "5.00 or greater" 98 "Not Ascertained" ; label define AI003X 10 "Sample Adult" 20 "Sample Child" 30 "Sample Adult Income" 40 "Sample Child Income" 50 "Paradata" 60 "Sample Adult Longitudinal" 70 "Sample Adult Partial" ; label define AI004X 0 "No" 1 "Yes" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; * IDN VALUE LABEL ASSOCIATIONS; label values rectype AI003X; * INC VALUE LABEL ASSOCIATIONS; label values incgrp_a AI001X; label values ratcat_a AI002X; label values inctcflg_a AI004X; describe; #delimit cr * data file is stored in adultinc.dta * log file is stored in adultinc.log log close