Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing levels on my covariates #72

Closed
wimul opened this issue May 11, 2021 · 2 comments
Closed

Missing levels on my covariates #72

wimul opened this issue May 11, 2021 · 2 comments

Comments

@wimul
Copy link

wimul commented May 11, 2021

I need some help, please. I used MatchIt and my matching object looks like this:

  • method: 1:1 optimal pair matching
  • distance: Propensity score
    - estimated with logistic regression
  • number of obs.: 10444 (original), 7774 (matched)
  • target estimand: ATT
  • covariates: factor(year), factor(Site), factor(Breeder), Region

I'm struggling to interpret the coefficients from coeftest( ) because for year, site and breeder, the computation is dropping more than one level. More precisely, for year, which has 15 different years, it is dropping 2; for site, which has 31 different site, it is dropping 5. The factor breeder has 3 and it's dropping just 1 what I think makes sense.

Thanks in advance for your help.

@ngreifer
Copy link
Collaborator

Levels of a factor are dropped in a regression when there are no units with those values or when they are linearly dependent on other variables (including levels of the same factor). What likely happened is that the matching changed the distribution of the covariates to yield one of the above phenomena. For example, it may be that after matching, all of the observations for a given breeder have the same region, and vice-versa, so that that level of breeder is redundant after including region in the model. You should examine the match.data() output to see if a phenomenon of this type is occurring.

@wimul
Copy link
Author

wimul commented May 24, 2021

Thanks, @ngreifer. I'll check and will let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants