Announcement

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

  • xtlogit, cluster on entity level

    Hello,

    Our data consists of 270 unique firms over a 20 year period (3300 firm-year specific observations).

    We have a problem in the steps following up to a PSM-model, where the xtlogit command does not allow me to cluster on entity level. The variable "treat" is a dummy variable taking value 1 if the firm has at least one female director; 0 otherwise. We want to estimate a propensity score which matches observations on the control variables.

    We want to have fixed effects on industry and year while clustering on entity level, this does not seem to work as "panels are not nested within clusters". The command "nonest" solved the problem when using xtreg but does not seem to work in xtlogit.

    Code:
    egen panel_id = group(Industry Year)
    sort Companyname
    egen company_id = group(Companyname)
    
    xtset panel_id
    
    xtlogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, i(panel_id) nonest vce(cluster company_id)
    error: panels are not nested within clusters
    r(498);


    Best regards.

  • #2
    You are estimating a random effects model. See the -fe- option for fixed effects.

    Comment


    • #3
      We have done fe now.

      Code:
      xtlogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, fe
      note: multiple positive outcomes within groups encountered.
      note: 522 groups (1,753 obs) omitted because of all positive or
      all negative outcomes.

      We do not want to omit any groups, is there a way to go around this?

      Code:
      xtlogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, fe vce(cluster company_id)
      Error: vcetype cluster not allowed
      r(198);

      Furthermore, the fe option does not support vcetype cluster.

      Comment


      • #4
        Originally posted by Ludvig Johansson View Post
        We have done fe now.

        Code:
        xtlogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, fe
        note: multiple positive outcomes within groups encountered.
        note: 522 groups (1,753 obs) omitted because of all positive or
        all negative outcomes.

        We do not want to omit any groups, is there a way to go around this?
        You are not omitting any observations. Such observations do not contribute to the likelihood and thus are excluded when using FE logit. However, the initial sample is your full sample.


        xtlogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, fe vce(cluster company_id)
        Error: vcetype cluster not allowed
        r(198);
        Try clogit instead, which is the same estimator as xtlogit, fe.

        Code:
        clogit treat logBS_w Performance_w logSIZE_w LEV_w CEOinboard Retearnings_w, group(panel_id) vce(cluster company_id) nonest

        Comment


        • #5
          Ludvig: How many industries are there? If not too many, I would do this a bit differently.

          Comment


          • #6
            Hi Jeff,

            We have two different industry variables that we can use for different purposes, one consists of 42 industries and the other of 10 industries. In the code above we have used the one with 42 industries but I can easily change and use 10 industries.

            Comment

            Working...
            X