I am trying to generate a new var RWTEL using combinations of two other variables. (ANY and THREETELE). The problem is that RWTEL shows 2 cases as "missing" even though they take on a value in the var THREETELE, a variable I generated using Q51 and which I use to generate RWTEL.
These two cases are coded as "13-Don't know" and "14-Other" in Q51.
I transformed Q51 "Don't Know" and "Other" to 2 in THREETELE. But these two cases show as missing in RWTEL
Here is my code for generating THREETELE variable:
Code:
Q51 -- OVERALL, for this .... ------------------------------------------------------------------- | Freq. Percent Valid Cum. ----------------------+-------------------------------------------- Valid 1 None | 12 7.89 14.46 14.46 2 1-5% | 34 22.37 40.96 55.42 3 6-10% | 15 9.87 18.07 73.49 4 11-20% | 7 4.61 8.43 81.93 5 21-30% | 3 1.97 3.61 85.54 6 31-40% | 1 0.66 1.20 86.75 7 41-50% | 2 1.32 2.41 89.16 8 51-60% | 2 1.32 2.41 91.57 12 91-100% | 5 3.29 6.02 97.59 13 Don't Know | 1 0.66 1.20 98.80 14 Other | 1 0.66 1.20 100.00 Total | 83 54.61 100.00 Missing . | 69 45.39 Total | 152 100.00 ------------------------------------------------------------------ gen THREETELE=. replace THREETELE=2 if Q51==2 | Q51==3 | Q51==4 | Q51==5 | Q51==6 | Q51==7 | Q51==8 | Q51==12 | Q51==13 | Q51==14 replace THREETELE=1 if Q51==1 . tab THREETELE THREETELE stelecom | Freq. Percent Cum. ------------+----------------------------------- 1 | 7 8.54 8.54 2 | 75 91.46 100.00 ------------+----------------------------------- Total | 82 100.00
Code:
gen RWTEL=. replace RWTEL=1 if ANY==2 & THREETELE!=2 replace RWTEL=2 if ANY==2 & THREETELE==2 replace RWTEL=3 if ANY=1 & THREETELE==2 tab RWTEL RWTEL | Freq. Percent Cum. ------------+----------------------------------- 1 | 7 8.75 8.75 2 | 27 33.75 42.50 3 | 46 57.50 100.00 ------------+----------------------------------- Total | 80 100.00
0 Response to Cases show up as missing in new var
Post a Comment