Skip to content
Prev 251926 / 398500 Next

stata.get labels glm()

Dear R community,

I would like to import data saved with Stata and then run a Probit model using R.

My data comes from the World Values Surveys and in the Probit model I want to control for countries.

So far I figured out that I should put "convert.factors = FALSE" when using stata.get() in order to import numeric values instead of label mappings, which is what I want for most of the variables. In a second step I would like to convert ONLY the country variable to a factor, such that glm() automatically controls for countries. With the latter point I am stuck, I managed to extract the country labels but don't know how to match this information now with my country variable 'v2'.
japan       mexico south africa      hungary    australia       tambov    argentina      finland  south korea 
13           14           15           16           17           20           22           23           24 



I know that I could put the option factor() in the Probit model but in my output then '13' instead of 'Japan' appears, which is not so nice, i.e.
Thanks a lot for your help.

Best regards,

Tobias