I reshaped some data from wide to long to make it easier to summarize (easier to conditionally count observations than to conditionally count variables within rows). The values in the original wide variables and in the new long variable are strings. When I try to do just about anything with the column created by reshaping, I get the error "factor-variable and time-series operators not allowed". This happened when I tried to reorder the variable with -order reshaped_var after(other_var)- and now I am getting it when I try to use -contract-, specifically -contract reshaped_var other_var freq(n) percent(perc)-.
The variable type/format is string (and all the variable values are strings) so I'm not sure why I am getting this error. It seems like maybe the variable is actually some sort of var list/factor variable as a result of reshape, but I'm not sure if that's accurate. How can I get this reshaped string variable into a format where I can actually manipulate the variable as I need to?
The variable type/format is string (and all the variable values are strings) so I'm not sure why I am getting this error. It seems like maybe the variable is actually some sort of var list/factor variable as a result of reshape, but I'm not sure if that's accurate. How can I get this reshaped string variable into a format where I can actually manipulate the variable as I need to?
Comment