Hi all,
How can I efficiently generate a new indicator variable wellchild = 1 if in any variable dx1 - dx29 contains Z0001, Z020, Z00129, Z23. Please check the example below. (Is there an efficiency loop or function to do this, since I have more id and variables than this exmaple)
Best,
Jack
How can I efficiently generate a new indicator variable wellchild = 1 if in any variable dx1 - dx29 contains Z0001, Z020, Z00129, Z23. Please check the example below. (Is there an efficiency loop or function to do this, since I have more id and variables than this exmaple)
Best,
Jack
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str10 beneid str7(dx1 dx2 dx3 dx4 dx5 dx6 dx7 dx8 dx9 dx10 dx11 dx12 dx13 dx14 dx15 dx16 dx17 dx18 dx19 dx20 dx21 dx22 dx23 dx24 dx25 dx26 dx27 dx28 dx29) "1" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "2" "H6692" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "3" "Q539" "Z00129" "Z23" "" "" "" "" "" "Z0001" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "4" "E611" "Z00129" "Z23" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "5" "Q539" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "6" "S0500XA" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Z0001" "7" "R05" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "Z020" "" "" "8" "J069" "R05" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "9" "J069" "R509" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "10" "J069" "R05" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" end
Comment