log using funcdisb.log, replace version 6.0 * THE FOLLOWING COMMAND TEMPORARILY CHANGES THE COMMAND- * ENDING DELIMITER FROM A CARRIAGE RETURN TO A SEMICOLON #delimit ; ********************************************************************* APRIL 15, 2015 4:54 PM THIS IS AN EXAMPLE OF A STATA DO PROGRAM THAT CREATES A STATA FILE FROM THE 2014 NHIS Public Use Functioning and Disability ASCII FILE NOTES: EXECUTING THIS PROGRAM WILL REPLACE funcdisb.dta AND funcdisb.log IF THOSE FILES ALREADY EXIST IN THE DEFAULT DIRECTORY THIS PROGRAM ASSUMES THAT THE ASCII DATA FILE IS IN THE STATA WORKING DIRECTORY. AN EXAMPLE OF HOW TO CHANGE THE WORKING DIRECTORY WITHIN STATA IS THE FOLLOWING COMMAND: cd c:\nhis2014\ THIS PROGRAM OPENS A LOG FILE. IF THE PROGRAM ENDS PREMATURELY, THE LOG FILE WILL REMAIN OPEN. BEFORE RUNNING THIS PROGRAM AGAIN, THE USER SHOULD ENTER THE FOLLOWING STATA COMMAND: log close THIS IS STORED IN funcdisb.do *********************************************************************; clear; set mem 200m; * INPUT ALL VARIABLES; infix rectype 1 - 2 srvy_yr 3 - 6 str hhx 7 - 12 intv_qrt 13 - 13 intv_mon 14 - 15 str fmx 16 - 17 str fpx 18 - 19 wtfa_afd 20 - 25 strat_p 26 - 28 psu_p 29 - 30 fdrn_flg 31 - 31 vis_0 32 - 32 vis_ss2 33 - 33 hear_1r 34 - 34 hear_2r 35 - 35 hear_ss2 36 - 36 hear_3 37 - 37 hear_4 38 - 38 mob_ss2 39 - 39 mob_2r 40 - 40 mob_3a 41 - 41 mob_3b2 42 - 42 mob_3c 43 - 43 mob_3d2 44 - 44 mob_3e2 45 - 45 mob_3f 46 - 46 mob_3g 47 - 47 mob_4 48 - 48 mob_5 49 - 49 mob_6 50 - 50 mob_7 51 - 51 mob_8 52 - 52 com_ss 53 - 53 com_2 54 - 54 cog_ss 55 - 55 cog_1 56 - 56 cog_2 57 - 57 cog_3 58 - 58 ub_ss 59 - 59 ub_1 60 - 60 ub_2 61 - 61 anx_1 62 - 62 anx_2 63 - 63 anx_3r 64 - 64 dep_1 65 - 65 dep_2 66 - 66 dep_3r 67 - 67 pain_2 68 - 68 pain_4 69 - 69 tired_1 70 - 70 tired_2 71 - 71 tired_3 72 - 72 rcs_afd 73 - 73 using funcdisb.dat; * DEFINE VARIABLE LABELS; label variable rectype "File type identifier"; label variable srvy_yr "Year of National Health Interview Survey"; label variable hhx "Household Number"; label variable intv_qrt "Interview Quarter"; label variable intv_mon "Interview Month"; label variable fmx "Family Number"; label variable fpx "Person Number (Within family)"; label variable wtfa_afd "Weight - Final Annual Functioning and Disability file"; label variable strat_p "Pseudo-stratum for public-use file variance estimation "; label variable psu_p "Pseudo-PSU for public-use file variance estimation"; label variable fdrn_flg "Disability Questions flag"; label variable vis_0 "Does respondent wear glasses?"; label variable vis_ss2 "Degree of difficulty seeing"; label variable hear_1r "Do you use a hearing aid?"; label variable hear_2r "How often do you use a hearing aid?"; label variable hear_ss2 "Degree of difficulty hearing"; label variable hear_3 " Difficulty hearing conversation with one person in quiet room"; label variable hear_4 " Diff hearing one person in noisier room even w/ hearing aid"; label variable mob_ss2 "Degree of difficulty walking or climbing steps"; label variable mob_2r "Use equipment or receive help for getting around?"; label variable mob_3a "Use cane or walking stick?"; label variable mob_3b2 "Use a walker or Zimmer frame?"; label variable mob_3c "Use crutches?"; label variable mob_3d2 "Use a wheelchair or scooter?"; label variable mob_3e2 "Use artificial limb (leg/foot)?"; label variable mob_3f "Use someone's assistance?"; label variable mob_3g "Use other type of equipment or help?"; label variable mob_4 " Diff walking 100 yards on level ground w/o aid or equipment"; label variable mob_5 " Diff walking 1/3rd mile on level ground w/o aid or equipment"; label variable mob_6 "Diff walking up or down 12 steps w/o aid or equipment"; label variable mob_7 " Diff walking 100 yards on level ground w/ aid or equipment"; label variable mob_8 " Diff walking 1/3rd mile on level ground w/ aid or equipment"; label variable com_ss "Degree of difficulty communicating using usual language "; label variable com_2 "Use sign language?"; label variable cog_ss "Degree of difficulty remembering or concentrating"; label variable cog_1 "Difficulty remembering, concentrating, or both?"; label variable cog_2 "How often have difficulty remembering?"; label variable cog_3 "Amount of things you have difficulty remembering?"; label variable ub_ss "Degree of difficulty with self-care"; label variable ub_1 " Diff raising 2 liter bottle of water from waist to eye level"; label variable ub_2 "Degree of difficulty using hands and fingers"; label variable anx_1 "How often feel worried, nervous, or anxious?"; label variable anx_2 " Take medication for worried, nervous, or anxious feelings?"; label variable anx_3r " Level of feelings when last felt worried, nervous, or anxious?"; label variable dep_1 "How often do you feel depressed?"; label variable dep_2 "Take medication for depression?"; label variable dep_3r "How depressed you felt last time you were depressed?"; label variable pain_2 "Frequency of pain in past 3 months"; label variable pain_4 "How much pain you had last time you had pain?"; label variable tired_1 "How often felt very tired or exhausted in past 3 months "; label variable tired_2 " How long most recent tired or exhausted feelings lasted?"; label variable tired_3 " Level of tiredness last time felt very tired or exhausted"; label variable rcs_afd "Record completion status"; * DEFINE VALUE LABELS FOR REPORTS; label define afp001x 10 "10 Household" 20 "20 Person" 25 "25 Income Imputation" 30 "30 Sample Adult" 38 "38 Functioning and Disability" 40 "40 Sample Child" 60 "60 Family" 63 "63 Family Disability Questions" 65 "65 Paradata" 70 "70 Injury/Poisoning Episode" 75 "75 Injury/Poisoning Verbatim" ; label define afp004x 1 "1 Quarter 1" 2 "2 Quarter 2" 3 "3 Quarter 3" 4 "4 Quarter 4" ; label define afp005x 01 "01 January" 02 "02 February" 03 "03 March" 04 "04 April" 05 "05 May" 06 "06 June" 07 "07 July" 08 "08 August" 09 "09 September" 10 "10 October" 11 "11 November" 12 "12 December" ; label define afp011x 1 "1 Families selected to receive AFD (sample adults) section" 2 " 2 Families selected to receive FDB (all persons 1 year and older) section" ; label define afp012x 1 "1 Yes" 2 "2 No" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp013x 1 "1 No difficulty" 2 "2 Some difficulty" 3 "3 A lot of difficulty" 4 "4 Cannot do at all/unable to do" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp015x 1 "1 All of the time" 2 "2 Some of the time" 3 "3 Rarely" 4 "4 Never" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp036x 1 "1 Difficulty remembering only" 2 "2 Difficulty concentrating only" 3 "3 Difficulty with both remembering and concentrating" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp037x 1 "1 Sometimes" 2 "2 Often" 3 "3 All of the time" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp038x 1 "1 A few things" 2 "2 A lot of things" 3 "3 Almost everything" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp042x 1 "1 Daily" 2 "2 Weekly" 3 "3 Monthly" 4 "4 A few times a year" 5 "5 Never" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp044x 1 "1 A little" 2 "2 A lot" 3 "3 Somewhere in between a little and a lot" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp048x 1 "1 Never" 2 "2 Some days" 3 "3 Most days" 4 "4 Every day" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp051x 1 "1 Some of the day" 2 "2 Most of the day" 3 "3 All of the day" 7 "7 Refused" 8 "8 Not ascertained" 9 "9 Don't know" ; label define afp053x 1 "1 Not ascertained answers only" 2 "2 Refused and don't know answers only" 3 "3 Refused, DK, and not ascertained answers only" 4 "4 At least one valid answer" ; * ASSOCIATE VARIABLES WITH VALUE LABEL DEFINITIONS; label values rectype afp001x; label values intv_qrt afp004x; label values intv_mon afp005x; label values fdrn_flg afp011x; label values vis_0 afp012x; label values vis_ss2 afp013x; label values hear_1r afp012x; label values hear_2r afp015x; label values hear_ss2 afp013x; label values hear_3 afp013x; label values hear_4 afp013x; label values mob_ss2 afp013x; label values mob_2r afp012x; label values mob_3a afp012x; label values mob_3b2 afp012x; label values mob_3c afp012x; label values mob_3d2 afp012x; label values mob_3e2 afp012x; label values mob_3f afp012x; label values mob_3g afp012x; label values mob_4 afp013x; label values mob_5 afp013x; label values mob_6 afp013x; label values mob_7 afp013x; label values mob_8 afp013x; label values com_ss afp013x; label values com_2 afp012x; label values cog_ss afp013x; label values cog_1 afp036x; label values cog_2 afp037x; label values cog_3 afp038x; label values ub_ss afp013x; label values ub_1 afp013x; label values ub_2 afp013x; label values anx_1 afp042x; label values anx_2 afp012x; label values anx_3r afp044x; label values dep_1 afp042x; label values dep_2 afp012x; label values dep_3r afp044x; label values pain_2 afp048x; label values pain_4 afp044x; label values tired_1 afp048x; label values tired_2 afp051x; label values tired_3 afp044x; label values rcs_afd afp053x; * DISPLAY OVERALL DESCRIPTION OF FILE; describe; * DISPLAY A TEST TABLE FROM THE FILE; tabulate rectype [fweight= wtfa_afd]; save funcdisb, replace; #delimit cr * data file is stored in funcdisb.dta * log file is stored in funcdisb.log log close