Hi all,
I am trying to destring the following values:
Less than 110
More than 70
Null
70 to 110
I managed to convert the string to numeric variables ie blue text using the following code:
encode movement, gen (movement_n)
I then proceeded with: (aiming to replace 1 for less than 110, 2 for more than 70, 3 for Null , 4 for 70 to 110)
Code used:
replace movement_n = 1 if movement_n == “Less than 110”
The error stata gives me is:
type mismatch
what am i doing wrong?
I am trying to destring the following values:
Less than 110
More than 70
Null
70 to 110
I managed to convert the string to numeric variables ie blue text using the following code:
encode movement, gen (movement_n)
I then proceeded with: (aiming to replace 1 for less than 110, 2 for more than 70, 3 for Null , 4 for 70 to 110)
Code used:
replace movement_n = 1 if movement_n == “Less than 110”
The error stata gives me is:
type mismatch
what am i doing wrong?
Comment