Announcement

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

  • Stata 15 insufficient observations

    Hi,

    I have recently updated Stata to version 15 (from 14) and discovered that this command below does not work even though there was no problem in Stata 12-14:

    Code:
    qui sum dtfp, detail
    xtreg dtfp legy##legi i.year if ( dtfp > r(p1) & dtfp < r(p99) ), fe cluster(company)
    where dtfp is my dependant variable, legy/legi is industry/time interaction...

    What I want to do is to get rid of extremes (more than 99th percentile and less than 1th percentile of dependent variables but I do not want the observations as I use them in following commands...
    Stata 14 always run this with no problem, Stata 15 gives 2001 error of insufficient observations...

    Can you please help me of what I should do to run this properly? What is different with Stata 15?

    Thanks

    Vojtech

  • #2
    Try this

    Code:
     
     qui sum dtfp, detail gen wanted = dtfp > r(p1) & dtfp < r(p99) xtreg dtfp legy##legi i.year if wanted, fe cluster(company)

    Comment


    • #3
      That should read as three lines:

      Code:
      qui sum dtfp, detail  
      gen wanted = dtfp > r(p1) & dtfp < r(p99)  
      xtreg dtfp legy##legi i.year if wanted, fe cluster(company)

      Comment


      • #4
        That works perfectly and is even quickier as I run more regressions without the same outliers. Thank you very much, Nick!

        Comment

        Working...
        X