ID | name | B1_04 | G7_A6 |
1 | Sam | 2 | 1 |
1 | Margaret | 1 | 2 |
9 | Jim | 5 | 1 |
9 | Cinderella | 1 | 1 |
29 | George | 2 | 2 |
29 | Natalie | 1 | 1 |
55 | Michael | 3 | 1 |
55 | Cari | 1 | 1 |
replace G7_A6="2" if B1_04=="3" | B1_04 =="4" | B1_04 == "5" | B1_04 =="6" |B1_04 =="7" replace G7_A6="1" if B1_04=="2" with this command both the obersevations for ID 1 should have G7_A6 = 1 for ID 9 should have G7_A6 = 2 for ID 29 should have G7_A6 = 1 for ID 55 should have G7_A6 = 2 and so on Yours sincerely, Pankaj
0 Response to STATA LOOP for Data Management
Post a Comment