hello all,
I'm trying to replace a string variable with a string variable so that ultimately i can just convert it all to a numeric variable and do some data analysis, but i'm stuck on the first step.
. describe dm_int
Variable Storage Display Value
name type format label Variable label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dm_int str5 %9s
. replace dm_int = "4" if dm_int ="<4.0"
type mismatch
r(109);
I'm very confused as to why this type mismatch is showing up.
Any advice?
I'm trying to replace a string variable with a string variable so that ultimately i can just convert it all to a numeric variable and do some data analysis, but i'm stuck on the first step.
. describe dm_int
Variable Storage Display Value
name type format label Variable label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
dm_int str5 %9s
. replace dm_int = "4" if dm_int ="<4.0"
type mismatch
r(109);
I'm very confused as to why this type mismatch is showing up.
Any advice?
Comment