I can't recast my variable from string to byte or from byte to string

Viewed 769

I have two datasets I would like to merge using Stata 15.1. Before I can do this I need to ensure the storage types are the same for the reference variables that I am using to join the data sets, a Country and a year variable. I changed the year variable into byte type with no issues; however, the Country variable, which is currently in a str26 type, comes up with the error Country: byte invalid.

I also tried going to my main data file where the Country storage type is byte and changing this into a string, but the same error shows, Country: str26 invalid.

I have tried using force recast str26 Country, force, and beyond this am not sure what to do.

0 Answers
Related