Contact_autism | Contact_autism1 |
1,2,4,8 | 0 |
1,6,7 | 1 |
6 | 1 |
6,8,9 | 1 |
Generate binary variable from string variable contents
Is there a way to generate a variable based on a string variable that contains numbers in a list? For example, I have a string variable like 'contact_autism' below and I'd like to create a binary variable like 'contact_autism1' equal to 1 for observations of contact_autism that contain 6. Thanks
0 Response to Generate binary variable from string variable contents
Post a Comment