Announcement

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

  • Reduced number of observations after xlogit, re

    Dear listers,

    I've got a problem using the xtlogit command with random effects.

    If I run this command for my panel data, with individual ID as panel variable and time-variable t, the number of observations is smaller than the number of all observations of my dataset. But there is no message that any variable or observations have been omitted.

    What could cause stata to not observe all observations of my dataset?

    Thanks for your replies!
    Last edited by Maximilian Bartels; 30 Jun 2017, 07:49.

  • #2
    Do you have any missings or singletons (only one observation per panel) in the data? What happens when you run a logit instead of xtlogit?

    Comment


    • #3
      Maximilian:
      as an aside to Jesse's helpfue advice, -codebook- your variable and search for singletons and missing data.
      As you may already know, Stata omits (via listiwise deletion) observations with missing values in any variable .
      Kind regards,
      Carlo
      (Stata 18.0 SE)

      Comment


      • #4
        Originally posted by Jesse Wursten View Post
        Do you have any missings or singletons (only one observation per panel) in the data? What happens when you run a logit instead of xtlogit?
        Thanks for your fast reply.

        If I run a logit instead of xtlogit, no variables are ommited and the results make sense. I took a look at summarize and found two variables with missing values.


        If I drop those variables, the number of observations make sense, but the effects of the independent variables are incomprehensible and not robust.

        I will try the -codebook- for each variable, thanks for the advice.

        Comment


        • #5
          Maximilian:
          what if you run -logit- with standard errors clustered on -paneiid-?
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6
            I just wish to recommend to share command and output. Surely, this is the best way to entice helpful replies.
            Best regards,

            Marcos

            Comment


            • #7
              Originally posted by Carlo Lazzaro View Post
              Maximilian:
              what if you run -logit- with standard errors clustered on -paneiid-?
              If I use the command

              Code:
               logit $ylist $xlist, vce(cluster id)
              the results are much closer to the results from the logit than to the xtlogit results, therefore much better. Can I use this method?

              Comment


              • #8
                Maximilian:
                Marcos remind you to increase your chances of getting helpful replies by posting what you typed and what Stata gave you back (as per FAQ). Thanks.
                That said, the code I suggested was aimed at investigating whether the same problems concerning missing values come alive with -logit-; clustering standard errors on -panelid- is manadatory with -logit-, because you were dealing with non-ondependent observations.
                That said, with panel data, -logit- outperforms -xtlogit- only when LR test of rho=0 appearing as a footnote of the -xtlogit- outcome table fails to reach stsistical significance. Unfortunately, that test is feasible with default standard errors only.



                Kind regards,
                Carlo
                (Stata 18.0 SE)

                Comment


                • #9
                  Originally posted by Carlo Lazzaro View Post
                  Maximilian:
                  Marcos remind you to increase your chances of getting helpful replies by posting what you typed and what Stata gave you back (as per FAQ). Thanks.
                  That said, the code I suggested was aimed at investigating whether the same problems concerning missing values come alive with -logit-; clustering standard errors on -panelid- is manadatory with -logit-, because you were dealing with non-ondependent observations.
                  That said, with panel data, -logit- outperforms -xtlogit- only when LR test of rho=0 appearing as a footnote of the -xtlogit- outcome table fails to reach stsistical significance. Unfortunately, that test is feasible with default standard errors only.


                  Thank you Carlo for your kind reply.

                  LR test of rho=0 reached statistical significance, so following your thoughts, I can't use a pooled -logit-.

                  I would like to post more detailed commands and the output, but for reasons of data privacy, I am not allowed to do that.

                  I checked all variables/panels for missing values or singletons, but there are none of it.

                  But still the outcome of -xtlogit- makes no sense and has changed algebraic signs and even much to high OR (>60), compared to the pooled -logit- command.

                  Comment


                  • #10
                    If data privacy is keeping you from posting the information that is needed to get help, why don't you create a new data set, with the same data, but first drop all the variables that are not part of the regression, and then change the names of all the remaining variables to something uninformative (e.g. var1 var2 var3 etc.) and run the -xtlogit- again using the corresponding new variable names. Then post example data from that along with the complete -xtlogit- output?

                    Comment

                    Working...
                    X