Announcement

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

  • estat sum error 498

    Hello everyone,

    I want to generate descriptive statistics after running my regression, using the "estat sum" command. However, if i try to run "estat sum", i get the following error code: ln_xrdintensity has 1 missing observation r(498). I do not understand the problem as the regression is running well. Can someone help me?


    regression code:
    Code:
    xtpoisson patents cl.ln_xrdintensity##cl.Numberofmergers cl2.ln_xrdintensity##cl2.Numberofmergers cl3.ln_xrdintensity##cl3.Numberofmergers l.ln_emp i.YearEffective i. AcquirorPrimarySICCode, fe vce (robust)
    estat code I want to run afterwards:
    Code:
    estat sum
    best regards

    Chris

  • #2
    That seems like a bug to me. The essence of estat sum is that it calculates summary statistics on the estimation sample - those observations actually used by the model. I assume you have run the estat sum immediately following the xtpoisson with no intervening commands that might have an unintended side effect.

    I was able to create a simple reproducible example of the problem.
    Code:
    clear all
    cls
    webuse nlswork, clear
    xtset idcode year
    xtreg ln_wage l.tenure
    estat sum
    estat sum l.tenure
    summarize l.tenure if e(sample)
    Code:
    . webuse nlswork, clear
    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
    
    . xtset idcode year
    
    Panel variable: idcode (unbalanced)
     Time variable: year, 68 to 88, but with gaps
             Delta: 1 unit
    
    . xtreg ln_wage l.tenure
    
    Random-effects GLS regression                   Number of obs     =     10,676
    Group variable: idcode                          Number of groups  =      3,677
    ...
    
    . estat sum
    tenure has 148 missing observations
    r(498);
    
    . estat sum l.tenure
    tenure has 148 missing observations
    r(498);
    
    . summarize l.tenure if e(sample)
    
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
          tenure |
             L1. |     10,676    2.722501    3.457858          0       24.5
    
    .
    This suggests a workaround to solve your immediate problem.

    Comment


    • #3
      I forwarded the above problem to Stata Technical Services and received a reply apologizing for the inconvenience and saying that it has been forwarded to the developers to be fixed in a future update.

      Comment


      • #4
        Thank you very much William! That helped me a lot

        Comment

        Working...
        X