Announcement

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

  • Relogit dummy variables

    I cannot figure out how to include year dummies for a relogit regression I am running.

    My data is at the company level, and looks like this:
    id year lobby size rev country owned unempl
    A 2001 1 15 130422 DE 0 8
    A 2002 1 15 187222 DE 0 8.2
    A 2003 1 28 167543 DE 0 8.4
    A 2004 1 33 168322 DE 0 9
    A 2005 1 33 182333 DE 0 8.7
    B 2000 0 6 UK 1 8.1
    B 2001 0 6 UK 1 8
    B 2002 0 7 UK 1 8.2
    C 2000 0 12 AT 0 8.1
    C 2001 0 12 AT 0 8
    C 2002 0 82 AT 0 8.2
    C 2003 0 76 AT 0 8.4

    My outcome (lobby) is binary, main IV (owned) is also binary. I have some time-varying variables (such as firm revenue and unemployment) and I am trying to find a way to include a time dummy.

    Relogit analysis look like this:

    relogit lobby owned rev size unemployment unempl

    Corrected logit estimates Number of obs = 371157

    ------------------------------------------------------------------------------
    | Robust
    lobby | Coefficient std. err. z P>|z| [95% conf. interval]
    -------------+----------------------------------------------------------------
    owned | 2.472867 .0862355 28.68 0.000 2.303848 2.641885
    rev | .4859777 .0303513 16.01 0.000 .4264902 .5454652
    size | -.1088001 .0322689 -3.37 0.001 -.172046 -.0455543
    unempl | -.0027092 .0344196 -0.08 0.937 -.0701703 .064752


    Any thoughts on how to include a year dummy and how to include it in a model? I can do include a separate variable for each year but then the model includes 10 additional variables …

    Thanks. in advance,
    Aydin

  • #2
    Code:
    relogit lobby owned rev size unemployment unempl i.year
    For details see the output of
    Code:
    help factor variables
    In doing so, you will still report 9 additional coefficient estimates - one for each of 9 years, and one year will be omitted to avoid collinearity.

    Added in edit: I see now that relogit, a community-contributed package available through SSC, although updated by the authors as recently as April 2021, does not support factor variable notation. You might be able to get what you need following the documentation for the largely obsolete xi prefix in
    Code:
    help xi
    Last edited by William Lisowski; 24 Nov 2022, 10:22.

    Comment


    • #3
      First off, relogit is not a built-in command. I assume you are referring to the rare events logit command available on SSC, but if not say what program you are using.

      What do you have against including dummy variables for year? That is what is typically done.

      If you fear the model will have too many variables, can year be treated as a continuous variable, i.e. do you expect a linear trend?

      Or, would it be reasonable to dichotimize year, e.g. does something big happen in 2003 that you think will produce changes from 2003 on?

      Also, relogit may not be your best or at least not your only choice; for example, firthlogit may be better. For discussions, see

      https://www3.nd.edu/~rwilliam/xsoc73994/RareEvents.pdf

      https://www.europeansurveyresearch.o...ionLeitg_b.pdf

      https://methods.sagepub.com/foundati...of-rare-events



      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      Stata Version: 17.0 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment


      • #4
        Originally posted by Richard Williams View Post
        First off, relogit is not a built-in command. I assume you are referring to the rare events logit command available on SSC, but if not say what program you are using.

        What do you have against including dummy variables for year? That is what is typically done.

        If you fear the model will have too many variables, can year be treated as a continuous variable, i.e. do you expect a linear trend?

        Or, would it be reasonable to dichotimize year, e.g. does something big happen in 2003 that you think will produce changes from 2003 on?

        Also, relogit may not be your best or at least not your only choice; for example, firthlogit may be better. For discussions, see

        https://www3.nd.edu/~rwilliam/xsoc73994/RareEvents.pdf

        https://www.europeansurveyresearch.o...ionLeitg_b.pdf

        https://methods.sagepub.com/foundati...of-rare-events


        Thanks very much Richard!

        -As I do not expect a linear trend, it won't work to treat year as a continuous variable - thanks for the suggestions though ...
        -I think you are right though, I can dichotomize a particular year, or another option is to choose particular years based on theoretical reasoning and use them as dummies
        -The discussions you suggested were also helpful! I still think relogit is the most ideal but firthlogit yield similar results anyway.

        On a second note, do you know a way I can interact variables in relogit? I was going to post this separately but I thought I would try my luck here first.
        I try to interact size and revenue but relogit command does not seem to allow interaction options - i keep getting the "factor-variable and time-series operators not allowed" warning ... any ideas?

        Comment


        • #5
          I imagine you would include interactions the old fashioned way -- calculate them yourself beforehand.

          gen sizrev = size * revenue
          relogit y size revenue sizrev

          Also you can probably use the horribly antiquated xi: prefix. I avoid it as much as possible, but it can be handy with commands that do not support factor variable notation.

          Finally, if someone was ambitious, they might be able to tweak relogit so it supported factor variable notation.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          Stata Version: 17.0 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment

          Working...
          X