Dear Stata users,
I have a problem when using the margins command for some of my models. In my analyses I compare the age gap between same-sex and mixed-sex couples across surveys. I do this for multiple countries separately. I also control for survey year since the surveys are not collected in the same year(s).
The problem: I noticed that the margins command works only if there is variation in the survey year variable in both surveys (in the example below: Belgium). I cannot get any estimates for countries which do not have variation on the survey year in one of the surveys (in the example below: Czech Republic). Since survey year is only a control variable and not part of the interaction term for which I would like the margins, I do not understand why I cannot get my estimates. The margins command works fine in all my models if I omit the survey year control variable.
Does anyone have an idea why this is happening?
Cheers,
Mirjam
(using Stata13)
Belgium: variation on survey year in both surveys
Czech Republic: no variation on survey year in survey 2
I have a problem when using the margins command for some of my models. In my analyses I compare the age gap between same-sex and mixed-sex couples across surveys. I do this for multiple countries separately. I also control for survey year since the surveys are not collected in the same year(s).
The problem: I noticed that the margins command works only if there is variation in the survey year variable in both surveys (in the example below: Belgium). I cannot get any estimates for countries which do not have variation on the survey year in one of the surveys (in the example below: Czech Republic). Since survey year is only a control variable and not part of the interaction term for which I would like the margins, I do not understand why I cannot get my estimates. The margins command works fine in all my models if I omit the survey year control variable.
Does anyone have an idea why this is happening?
Cheers,
Mirjam
(using Stata13)
Belgium: variation on survey year in both surveys
Czech Republic: no variation on survey year in survey 2