And label them data not foundshow frequency table the new variable
Ans. Command mvdecode asthma asthma_b , mv(9=.a) #replaces 9 with .a extension in both the variables.
If applicable, code to extended missing values (.b) all non-applicable values (coded as 8).
Yes asthma but none of the two above options (code 3)
No asthma (code 4)
recode asthmadiagnosis (0=3) if asthma==1 & asthma_b==3
recode asthmadiagnosis (0=4) if asthma==2
Ans. Command:
label variable asthmadiagnosis "Asthma diagnosis" # Label the variable as "Asthma diagnosis"
label values asthmadiagnosis Asthma_diagnosis # Assigns these label values to the variable asthmadiagnosis
Show a frequency table of the new variable
astm_d_a- If yes, how many days?
Generate a numerical variable indicating the number of days missing, coding as zero (“0”) those reporting not missing any days.
The first question on days missed due to asthma is a filter question, so the first item on missing days has a code for non-applicable. Code these NA in the first variable as extended missing (.b) and label them.
Ans. Command:-
Note : Data not found
Show a frequency table of the new variable.