I am trying to reshape one string variable into many. I am getting an error that says ", not allowed"
the variable I want to reshape, var1, is coded like this
but when I try the code:
gen byte var1_long_ = 1
reshape wide var1_long_, i(ID) j(var1) string
I get an error ", not allowed"
How can I code so that the commas are not used in the new variable names, just the numbers and letters ?
the variable I want to reshape, var1, is coded like this
ID | var1 |
1 | a, 2b, c |
2 | 1a, b |
3 | 3a, |
4 | 2a, 2b, 3b |
gen byte var1_long_ = 1
reshape wide var1_long_, i(ID) j(var1) string
I get an error ", not allowed"
How can I code so that the commas are not used in the new variable names, just the numbers and letters ?
Comment