Made a categorical variale with 4 categories out of one with 55, now different result

#1
Hi!

I'm busy working on my research, but I ran into a problem.
I'm using a logstic regression to estimate the influence of certain independent variables on my (dummy) dependent variable. Then I want to interpret the results with marginal effects.
The problem is one of the controlvariables, 'country'.
In the dataset there are 55 countries coded. I made a dummy of them using i.country in the regression and made dummies of them using: tabulate country, gen(dcountry).
The logistic regression worked, but I waited almost 24 hours and still the marginal effects were not calculated (because of the high number of countries). When I didn't include country it worked.

So I made a new categorical variable : 'continent' using gen continent=. and then filling the countries in per continent.
I constructed 4 categories out of the countries. I included three of the categories in the regression and it worked. As well as the marginal effects. However the results were different than when using the 55 countries. This should not be the case right?
Could someone help me what I should do, or did I do it right and should the outcomes be different?
Thanks for the help!
 

bukharin

RoboStataRaptor
#2
Re: Made a categorical variale with 4 categories out of one with 55, now different re

This is expected - by condensing the 55 countries into 4 groups you've thrown away some information and changed the model - so your results pretty much had to change.

Do you have just one observation per country? If so it doesn't make any sense to have a dummy for each one, because then your model will perfectly predict the outcome. If you have multiple observations per country then a more standard approach would be a fixed effects model using -xtlogit-
 
#3
Re: Made a categorical variale with 4 categories out of one with 55, now different re

Hi!
Thanks! I'm still discovering Stata, so I didn't know if this was the case.
I have a total of 24,000 observations, differing how many per country (the smallest number is 97 for France).
I will try the xtlogit model! In this model I have to add the 55 countriedummies (i.country) in stead of the 4 selfmade categories, right?
 

bukharin

RoboStataRaptor
#4
Re: Made a categorical variale with 4 categories out of one with 55, now different re

No, you don't use dummies - the model is essentially stratified by country rather than estimating an effect for each country. You need to do some more reading about this - you won't be able to fit the models properly without understanding the underlying theory. A good place to start is this book, or a proper course in multilevel modeling.