Dear Statalist Member
I am estimating the expected probability of not having good health, using the command -margins, according to the socioeconomic position in each state of Brazil divided between capital and interior. I created a variable matching the state and whether the person is in the capital or the interior. The goal was to add more cases in each category.
Let's call this categorical variable of statecapital. As an example, for Rio de Janeiro, code 33, a category 331 was created for Rio de Janeiro Capital and 330 for Rio de Janeiro interior; and so for all 26 Brazilian States. The socioeconomic position of the person is measured by a binary variable, coded 1 for top and 0 for non-top jobs.
The sample is complex and I have used the svy command.
As an example, the syntax looks like this:
svy: logit notgoodhealth i.statecapital i.top \\ covariates
[state variable was combined with the binary variable capital]
margins statecapital#top
However, I realized that by doing the estimation with the separated variables, using the margins, the results diverge. There are no differences between the estimates in the number of cases, covariates and conditioners.
The syntax in this case was:
svy: logit notgoodhealth i.state i.capital i.top \\ covariates
[state and capital are used as separated variables]
margins state#capital#top
The difference may be ponderable. The probability of someone at the top in the capital of a state changes from 0.109 to 0.128 between the two estimates. Without using the svy command and the sample weights the difference persists. In this case the difference changes from 0.116 to 0.122. It seems to have no relation to the sample weights.
Why does the command -margins produce these differences?
What would be the most appropriate way of estimating?
Thanks in advance.
Prof. José Alcides F. Santos
I am estimating the expected probability of not having good health, using the command -margins, according to the socioeconomic position in each state of Brazil divided between capital and interior. I created a variable matching the state and whether the person is in the capital or the interior. The goal was to add more cases in each category.
Let's call this categorical variable of statecapital. As an example, for Rio de Janeiro, code 33, a category 331 was created for Rio de Janeiro Capital and 330 for Rio de Janeiro interior; and so for all 26 Brazilian States. The socioeconomic position of the person is measured by a binary variable, coded 1 for top and 0 for non-top jobs.
The sample is complex and I have used the svy command.
As an example, the syntax looks like this:
svy: logit notgoodhealth i.statecapital i.top \\ covariates
[state variable was combined with the binary variable capital]
margins statecapital#top
However, I realized that by doing the estimation with the separated variables, using the margins, the results diverge. There are no differences between the estimates in the number of cases, covariates and conditioners.
The syntax in this case was:
svy: logit notgoodhealth i.state i.capital i.top \\ covariates
[state and capital are used as separated variables]
margins state#capital#top
The difference may be ponderable. The probability of someone at the top in the capital of a state changes from 0.109 to 0.128 between the two estimates. Without using the svy command and the sample weights the difference persists. In this case the difference changes from 0.116 to 0.122. It seems to have no relation to the sample weights.
Why does the command -margins produce these differences?
What would be the most appropriate way of estimating?
Thanks in advance.
Prof. José Alcides F. Santos
Comment