something like str2num ?
Posted: Thu Dec 04, 2014 2:19 pm
1 I have a series with numbers stored as string (for some reason that is how they were imported from xls / although in xls they are stored as numbers).
How to convert the whole series in number format?
Otherwise I receive the following info: "alpha series in specification DUM_POZICIJA (name of my problematic series) @expand can convert to categorical dummies"
2 The series was made with the program>
smpl @all
alpha dum_pozicija="4"
dum_pozicija= @recode(poz01 ="18" or poz01="23","1",dum_pozicija)
dum_pozicija= @recode(poz01 ="1" or ...,"2",dum_pozicija)
etc...
But if I tried to use numbers (4) instead of strings ("4") I receive a message "cannot assign numeric expression to string variable in "alpha dum_pozicija=4".
Can I somehow define numbers in the above program?
How to convert the whole series in number format?
Otherwise I receive the following info: "alpha series in specification DUM_POZICIJA (name of my problematic series) @expand can convert to categorical dummies"
2 The series was made with the program>
smpl @all
alpha dum_pozicija="4"
dum_pozicija= @recode(poz01 ="18" or poz01="23","1",dum_pozicija)
dum_pozicija= @recode(poz01 ="1" or ...,"2",dum_pozicija)
etc...
But if I tried to use numbers (4) instead of strings ("4") I receive a message "cannot assign numeric expression to string variable in "alpha dum_pozicija=4".
Can I somehow define numbers in the above program?