My data consists of multiple countries (40 different countries) such as the US, UK, China, The level of analysis is company. Thus, I include country dummies, industry dummies (i.sic) in control variables. The estimation mode is random effects. Year dummies (i.year) are also included.

How can I create country dummies? Industry and year dummies are numeric and easy to transform to dummies. But, the data type of country variables is character. Do I need to transform country variables into numeric ones before creating dummies?

I tried to create numeric country dummies as follows.

Code:
encode country, gen
Am I on the right track?