Announcement

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

  • How to deal with "outcome does not vary in any group" when dealing with xtlogit

    In my case, I am finding pscore for doing PSM. To get there, I need to run the logistic regression to get the pscore. Thank you Clyde Schechter that I confirm my xtlogit with two way fixed effects.
    In my setting, I have 7 countries, all firms in country A have the "treatment" variables equal to 1, otherwise 0.

    My logit regression is

    Code:
    xtset firm year
    xtlogit treatment  firm-level-variables  country-level-variables i.year, fe
    while treatment equal to1 if firms in country A and 0 otherwise. firm-level-variables includes firm size, firm age... country-level variables include lngdp, unemployment ....

    When running the regression

    Code:
    xtlogit treatment firm_age i.year, fe
    I got the error immediately

    Code:
    outcome does not vary in any group
    So, I asked myself and think this means that in at least one group, all observations have either a 0 or a 1 as the outcome variable. It makes sense because all observations of firms in country A will have treatment =1 and all observations of firms in other countries will have treatment=0, so they wont vary.

    I am not sure whether my understanding is correct. If it is the case, would you please guide me how to overcome the problem. Thank you.



    Last edited by Phuc Nguyen; 03 Apr 2023, 13:23.

  • #2
    Fixed-effects logistic regression is not an appropriate analysis for the purpose of constructing a propensity score. It would inevitably encounter the problem you have: because the "outcome" (treatment vs control) is time-invariant, and -xtlogit, fe-, like all fixed-effects models, estimates only the within-panel effects, there is nothing to estimate here. The within-panel effects of all variables are zero.

    Creating a propensity model for longitudinal data is a complicated and challenging subject, about which I do not have sufficient expertise to advise you. Hopefully others who are following along do and will offer their opinions.

    Comment

    Working...
    X