If you check the range of the original string variable it starts at zero but if we use encode to transform the string into a numerical value, it yields the data starts at 1. The code used is encode Variable, gen (New Variable).
We tried to use real() instead but it drops the non-numeric values which we need to keep in for the analysis to be correct.
How can we transform the string into numerical values without the zeros being non-recognised?
We tried to use real() instead but it drops the non-numeric values which we need to keep in for the analysis to be correct.
How can we transform the string into numerical values without the zeros being non-recognised?
Comment