Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • poisson model with robust standard errors to estimate the relative risk

    Hi there,

    I am using code based off the following:


    glm lenses ib1.carrot ib2.gender latitude, fam(poisson) link(log) nolog vce(robust) One of my binary variables comes back with variable 0 0.5027423 1 omitted 2 empty And the note: note: 1.variable omitted because of collinearity note: 2.variable identifies no observations in the sample The others work out fine. Can someone please help me? Is there another way to specify the model (poisson with robust standard errors) to produce a relative risk? Thanks SO MUCH!

  • #2
    Second question first: add the -eform- option and you will get the results reported as incidence rate ratios (which is the same thing as relative risk).

    There is nothing wrong with how you specified the model in your code. The problem, if there is one at all (and there may not be any) is with your data. For some reason, you didn't say which of your variables was the one flagged in the notes. But here's what's going on. Remember that in any regression model, observations are included in the estimation sample only if they have non-missing values for every variable mentioned in the model. So any observation that doesn't have a non-missing value for lenses, carrot, gender, and lattitude in your data set will be excluded from your Poisson regression. Now, as it turns out, among the remaining observations, there aren't any that have variable == 2. So Stata drops 2.variable from the model. But now there is a problem. Initially, Stata counted up the number of levels that variable has, and omitted one as the reference category--standard handling of discrete variables. But because 2 turned out not to actually occur in the estimation sample, Stata is left with one too many indicators ("dummy variables") for that discrete variable, so it has to get rid of one. That's what the message 1.variable omitted because of collinearity is telling you. So all of this is just a cascade of events owing to the absence of variable = 2 observations in the estimation sample.

    So if there is a problem, the problem is in your data. Why are there no observations with variable == 2 in the estimation sample? You need to review your data and the data management that created your data set to determine whether this is an error, or just the way it is in the real world. If it's an error, then you need to rework the data management to fix the problem. If that's just how the world is, then there's nothing that needs to be done: the results you have are just fine.
    Last edited by Clyde Schechter; 04 Nov 2020, 16:13.

    Comment

    Working...
    X