Hello
I am trying to convert a string variable in one year (2013) of my data, so that I can append it to the remaining years (2009-2012) in my dataset.
The variable is simply an ID number that corresponds to certain hospitals in a given state, so there are no hypens or other characters to consider.
So far I have tried the following:
destring AHAID, generate(AHAID_n) - which converts it to numeric (long)
gen AHAID_n = real(AHAID) - which converts it to numeric (float).
Neither of these options allow me to append this year with the previous years where that variable is numeric (double), and when I use the force command it just treats it as missing.
please help. Thanks
I am trying to convert a string variable in one year (2013) of my data, so that I can append it to the remaining years (2009-2012) in my dataset.
The variable is simply an ID number that corresponds to certain hospitals in a given state, so there are no hypens or other characters to consider.
So far I have tried the following:
destring AHAID, generate(AHAID_n) - which converts it to numeric (long)
gen AHAID_n = real(AHAID) - which converts it to numeric (float).
Neither of these options allow me to append this year with the previous years where that variable is numeric (double), and when I use the force command it just treats it as missing.
please help. Thanks
Comment