Announcement

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

  • Error r2000: No observations ; using xtreg

    Hello everybody,

    I am new to stata and up till now previous posts helped me to where I am now, thanks for that to all.
    I have ran a rangestat regression to get the coefficient for a four factor model regression, I think I succeeded in this. For this I used the following regression

    rangestat (reg) ER ERM SMB HML WML , interval(Date . -1)

    The problem however is that when I want to use the coefficient in another regression: xtreg, this returns the error message: r2000 no observations.
    This regression I mentioned does not have string variables, but does have missing values so I think the panel data is unbalanced. (or a more obvious problem I do not see now)

    For the first regression mentioned below there is a table that is produced, but with a zero as the coefficient in the results, for the second one not even a table can be produced mentioning the error r2000: no observations.

    xtreg b_consNet Ratingnr i.Date
    outreg2 using 1.1A1.doc, replace ctitle (1) tstat addtext (Firm FE, YES, Time FE, YES)

    xtreg b_consNet SRI EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 SIZE_ln i.Date
    outreg2 using 1.2A.doc, replace ctitle (1) tstat addtext (Firm FE, YES, Time FE, YES)

    I really do not know where I go wrong. Do you guys have any tips or pointers that can lead me in the right direction? Or things I can adapt to rewrite my code that it works correctly?

    Thanks in advance,
    Jur

  • #2
    Show us minimally the results of

    Code:
    xtset
    A common cause here is that you have no observations at lag 1. But you don't give example data such as we request.

    Comment


    • #3
      I am sorry that I do not know how to put lines of code into a different ''code box'' vut this is the code i run

      xtset Name_nr Date


      and these are the results.

      panel variable: Name_nr (strongly balanced)
      time variable: Date, 01jan2012 to 01mar2018, but with gaps
      delta: 1 day

      I hope this helps in solving the problem.

      Comment


      • #4
        Every time you post you are reminded to read https://www.statalist.org/forums/help before posting. https://www.statalist.org/forums/help#stata explains how to use CODE delimiters.

        Here is a guess. You really have monthly data which just happen to be labelled by the daily dates for the start of each month. Stata just goes on what you tell it, which is that the time variable is a daily date. It has no emotions (fear or even concern) about your data having gaps of length 27, 28, 29, or 30 days. It's following the laws of robotics.

        You need, if so, to create a monthly date variable and xtset in terms of that.

        Code:
        gen MDate = mofd(Date) 
        format MDate %tm 
        xtset Name_nr MDate
        If that doesn't solve the problem, you'll need to show us a data example. Again, https://www.statalist.org/forums/help#stata explains how.

        Comment


        • #5
          Indeed, I have monthly data and changed it with your code provided. The problem remained the same however.
          Below you can find a data example from my sample using the dataex ssc.

          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input double b_consNet byte SRI double(EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER) int Holdings double Stdev byte(Load dummy90) float SIZE_ln
                   . 1           .  .006950227800891668 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   . 1           .  .010148632721320184 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   . 1           .  .011566932873644126 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   . 1           .  .011796189358193546 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   . 1           .  .010809056199541882 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.03044248 1           .   .00713030590223979 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.06292031 1           .   .00838860696521819 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.02591407 1           .  .008199895149133307 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
            .0024415 1           .  .008972761118448457 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           .00988509 1           .  .009618872022821932 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00315705 1           .  .008663047981018758 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00435281 1           .  .008842305394127415 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00401596 1           .   .00930575548541107 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00474879 1           .  .010944248388203716 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00709537 1           .  .010721913633803239 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00562055 1           .  .011417425621086346 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00477055 1           .  .011419572455144827 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00519502 1           .  .011660872872807523 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00396137 1           .  .010653974531842804 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00296342 1           .  .012114751390161403 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00113821 1           .  .010824098369776106 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00137897 1           .  .012247284315993971 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00133876 1           .  .013003922863556302 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00062465 1           .  .013115024099098616 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00047945 1           .   .01334634557267867 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00046203 1           .  .011459451676916027 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00045349 1           .   .01292582437014578 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
            .0005769 1           .  .012577405843490248 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           .00197853 1           .   .01197261932387837 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           .00100762 1           .  .012190764160228457 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           -.0001069 1           .  .012753297432628314 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00012789 1           .  .011446132782172394 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           .00003071 1           .  .012344541738527164 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
          -.00049256 1           .  .010819933887117198 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
           .00055378 1     2790499  .011376298288838382 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.851006
           .00068214 1 -112411.013  .011405520435672813 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.825927
           .00063486 1   45789.042  .010853551811452637 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.807092
           .00087789 1   23170.155   .00634627770075751 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.868153
           .00114599 1   110557.36  .012472524539466883 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.908542
           .00264322 1  255754.533  .010324373915256035 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.996978
           .00157121 1  370757.288  .010235194567431806 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.109855
           .00176928 1  228396.927  .011105573511040912 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.166988
          -.00140485 1  126897.305  .010750015318956236 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.185165
          -.00172544 1  103141.049  .009796328788394851 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.181915
           .00056115 1  130484.717  .007893705689521122 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.177285
           .00218277 1  295978.848  .005544197247639924 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.307487
           .00213341 1   70561.231  .007350461375456835 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.331666
           .00348462 1   -36640.08  .007324005315081908 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.27185
           .00187262 1  564676.649  .005681782349197448 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.33642
            .0018523 1  298601.797  .003777679495228002 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.418322
           .00372176 1  214960.374 .0033574242999409388 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.551878
           .00414871 1  189171.453  .005274016503031338 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.598698
           .00325984 1  166226.058  .005133491013350546 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.607967
           .00226935 1  174025.714  .005552559410934224 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.637492
           .00093202 1  133643.145  .005733286333452386 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.694386
           .00170281 1  183942.637  .007036022823492268 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.742396
           .00257243 1  162496.669   .00802747347828529 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.771292
           .00192289 1    88367.04  .009324343000147228 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.74883
           .00118667 1  107763.399  .007178063604187584 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.850378
           .00117278 1 1055072.226  .008102498532271952 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.995158
           .00118011 1   399690.91  .008451313664125139 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.055363
           .00042599 1   758818.84  .008152666439509269 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.152199
           .00049391 1 1628571.155  .008110895478162924 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.318846
           .00049975 1 1699368.178  .007969462008870491 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.452682
           .00025341 1  941831.358  .008317854075448909 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  16.49576
           .00016075 1  876366.873   .00941680091162802 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.580273
           .00022027 1  645812.255  .009150651563222478 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  16.64694
            .0003293 1 3183373.187  .009467478205013124 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.811977
           .00022743 1 1359358.982  .009047265894811819 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.934553
           .00041686 1 1539686.219  .009237929100449165 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.984503
           .00051512 1 1192090.474  .009697524459745635 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.068336
           .00041387 1 3715758.297  .009960633168080418 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.208672
           .00113756 1 4211554.026  .009834785833022577 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.364716
           .00120127 1 3210055.549  .009977774011619058 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.404324
           .00120127 1 2198422.736  .009088695445233493 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.451433
                   . 1           .  .006950227800891668 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                   . 1           .  .010148632721320184 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                   . 1           .  .011566932873644126 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                   . 1           .  .011796189358193546 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                   . 1           .  .010809056199541882 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.03044248 1           .   .00713030590223979 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.06292031 1           .   .00838860696521819 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.02591407 1           .  .008199895149133307 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
            .0024415 1           .  .008972761118448457 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
           .00988509 1           .  .009618872022821932 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00315705 1           .  .008663047981018758 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00435281 1           .  .008842305394127415 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00401596 1           .   .00930575548541107 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00474879 1           .  .010944248388203716 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00709537 1           .  .010721913633803239 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00562055 1           .  .011417425621086346 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00477055 1           .  .011419572455144827 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00519502 1           .  .011660872872807523 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00396137 1           .  .010653974531842804 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00296342 1           .  .012114751390161403 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00113821 1           .  .010824098369776106 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00137897 1           .  .012247284315993971 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00133876 1           .  .013003922863556302 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00062465 1           .  .013115024099098616 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          -.00047945 1           .   .01334634557267867 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
          end
          On this datasample I want to run the following regression:
          Code:
          xtreg b_consNet SRI EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 SIZE_ln i.Date
          outreg2 using 1.2A.doc, replace ctitle (1) tstat addtext (Firm FE, YES, Time FE, YES)
          I hope this helps, and is in the correct format. Thanks for all your help already!

          Comment


          • #6
            Thanks for a data example in the correct format. I see here example data for

            Code:
            b_consNet  
            SRI  
            EstimatedFundLevelNetFlow  
            Averagetimereturn  
            Tenurelongest  
            Age  
            Turnover  
            NETER  
            Holdings
            Stdev  
            Load  
            dummy90
            SIZE_ln
            so I can't relate that to the xtset settings at all. Did I miss those variables? What's the error message exactly?

            Comment


            • #7
              The error is the following:

              Code:
              . xtreg b_consNet SRI EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age 
              > Turnover NETER Holdings Stdev Load dummy90 SIZE_ln i.Date
              note: 21244.Date omitted because of collinearity
              no observations
              r(2000);
              
              . 
              . outreg2 using 1.2A.doc, replace ctitle (1) tstat addtext (Firm FE, YES, Time FE, Y
              > ES)
              matrix e(b) not found; run/post a regression, or specify varlist for non-regression 
              > outputs
              r(111);
              What do you mean with respect to the xtset setting? Do I need to include all the variables in there from the beginning or am I understanding you incorrectly?
              In the above code box I directly copied the regression and the outputs I get with the errors accompanying it.

              The variables you mentioned in your code box are the correct variables I want to use, didn't they show correctly in my data example? I see ''double()'' standing in the upper row, which is not how it is represented in the sample itself. Is that correct?

              To be sure, below are my xtset settings as you suggested with the monthly date settings

              Code:
              . format MDate %tm 
              
              . 
              . xtset Name_nr MDate
                     panel variable:  Name_nr (strongly balanced)
                      time variable:  MDate, 2012m1 to 2018m3
                              delta:  1 month
              I truly appreciate your help, thank you so much
              Jur

              Comment


              • #8
                The xtset information looks fine, so I guess the problem lies in what else you're asking. I suspect you're trying to estimate far more parameters than the data will allow, but it seems that there are other problems too.

                Clearly outreg2 (SSC, as you are asked to explain) is failing because there are no results to show.

                Comment


                • #9
                  My apologies, indeed I used the outreg2 SSC. And that only does not work because of the lack of results from the regression itself.
                  The variables shown above are all independent variables (including control variables).
                  What do you mean exactly with the number of parameters I would like to estimate? Is there anything I can do about that?
                  From the regression I want to get to know there coefficient and t stat, not much more.
                  In other regressions where I use a different dependent variable this regression does actually work.

                  In the code box below you can see the full set of regression I will use in this part of my research. In there I use the outreg2 SSC and the xtreg SSC.

                  Code:
                  xtreg b_consNet SRI EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 SIZE_ln i.Date
                  outreg2 using 1.2A.doc, replace ctitle (1) tstat addtext (Firm FE, YES, Time FE, YES)
                  xtreg b_consNet Ratingnr EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 SIZE_ln i.Date
                  outreg2 using 1.2A.doc, append ctitle (2) tstat addtext (Firm FE, YES, Time FE, YES)
                  xtreg b_consGross  SRI SIZE_ln EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 i.Date
                  outreg2 using 1.2A.doc, append ctitle (3)  tstat addtext (Firm FE, YES, Time FE, YES)
                  xtreg b_consGross Ratingnr SIZE_ln EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER Holdings Stdev Load dummy90 i.Date
                  outreg2 using 1.2A.doc, append ctitle (4)  tstat addtext (Firm FE, YES, Time FE, YES)
                  Below another data example gathered by using the dataex SSC, in there all the dependent and independent variables are added mentioned in the code above.

                  Code:
                  * Example generated by -dataex-. To install: ssc install dataex
                  clear
                  input double(b_consNet b_consGross GrossSTYLEalpha NetSTYLEalpha) byte SRI double(EstimatedFundLevelNetFlow Averagetimereturn Tenurelongest Age Turnover NETER) int Holdings double Stdev byte(Load dummy90) float SIZE_ln
                           .         .                      .                     . 1           .  .006950227800891668 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                           .         .                      .                     . 1           .  .010148632721320184 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                           .         .                      .                     . 1           .  .011566932873644126 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                           .         .                      .                     . 1           .  .011796189358193546 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                           .         .                      .                     . 1           .  .010809056199541882 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.03044248 .01004454                      .                     . 1           .   .00713030590223979 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.06292031  .0100368                      .                     . 1           .   .00838860696521819 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.02591407 .01001097                      .                     . 1           .  .008199895149133307 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                    .0024415 .01014231                      .                     . 1           .  .008972761118448457 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   .00988509 .01013576                      .                     . 1           .  .009618872022821932 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00315705 .01013495                      .                     . 1           .  .008663047981018758 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00435281 .01009877                      .                     . 1           .  .008842305394127415 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00401596 .01009783                      .                     . 1           .   .00930575548541107 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00474879 .01010065                      .                     . 1           .  .010944248388203716 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00709537 .01009021                      .                     . 1           .  .010721913633803239 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00562055 .01009543                      .                     . 1           .  .011417425621086346 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00477055 .01007583                      .                     . 1           .  .011419572455144827 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00519502 .01007577                      .                     . 1           .  .011660872872807523 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00396137 .01006727                      .                     . 1           .  .010653974531842804 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00296342 .01006168                      .                     . 1           .  .012114751390161403 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00113821 .01007141                      .                     . 1           .  .010824098369776106 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00137897 .01007192                      .                     . 1           .  .012247284315993971 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00133876 .01007042                      .                     . 1           .  .013003922863556302 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00062465 .01006874                      .                     . 1           .  .013115024099098616 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00047945 .01006483                      .                     . 1           .   .01334634557267867 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00046203 .01005256                      .                     . 1           .  .011459451676916027 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00045349 .01005305                      .                     . 1           .   .01292582437014578 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                    .0005769 .01005068                      .                     . 1           .  .012577405843490248 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   .00197853 .01003062                      .                     . 1           .   .01197261932387837 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   .00100762 .01002361                      .                     . 1           .  .012190764160228457 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   -.0001069 .01001487                      .                     . 1           .  .012753297432628314 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00012789  .0100138                      .                     . 1           .  .011446132782172394 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   .00003071 .01001374                      .                     . 1           .  .012344541738527164 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                  -.00049256 .01001466                      .                     . 1           .  .010819933887117198 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1         .
                   .00055378 .01001502                      .                     . 1     2790499  .011376298288838382 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.851006
                   .00068214 .01001342                      .                     . 1 -112411.013  .011405520435672813 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.825927
                   .00063486 .01000814   -.039347031288775036   -.04019703128877504 1   45789.042  .010853551811452637 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.807092
                   .00087789 .01000805   -.002432111040358672  -.003282111040358672 1   23170.155   .00634627770075751 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.868153
                   .00114599 .01000574   -.004547633299911744 -.0053976332999117445 1   110557.36  .012472524539466883 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.908542
                   .00264322 .00999753  -.0022223508210556814 -.0030723508210556815 1  255754.533  .010324373915256035 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 14.996978
                   .00157121 .00999314   -.003755335725446521  -.004605335725446522 1  370757.288  .010235194567431806 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.109855
                   .00176928 .00999054   -.006275451338015768  -.007125451338015768 1  228396.927  .011105573511040912 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.166988
                  -.00140485 .00998041   -.007340343017316788  -.008190343017316788 1  126897.305  .010750015318956236 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.185165
                  -.00172544  .0099835   -.009837972745105412  -.010687972745105412 1  103141.049  .009796328788394851 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.181915
                   .00056115 .00997422   -.011130968557757404  -.011980968557757404 1  130484.717  .007893705689521122 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.177285
                   .00218277 .00997308   -.005776306368751386  -.006626306368751386 1  295978.848  .005544197247639924 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.307487
                   .00213341 .00997239   -.005419330087435663  -.006269330087435663 1   70561.231  .007350461375456835 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.331666
                   .00348462 .00997485   -.007019645895191794  -.007869645895191794 1   -36640.08  .007324005315081908 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.27185
                   .00187262 .00997589    -.00966252327868462   -.01051252327868462 1  564676.649  .005681782349197448 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.33642
                    .0018523 .00997906   -.007571974102210499    -.0084219741022105 1  298601.797  .003777679495228002 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.418322
                   .00372176 .00998626   -.002494796703282422  -.003344796703282422 1  214960.374 .0033574242999409388 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.551878
                   .00414871 .00998612  -.0017556530975560173 -.0026056530975560174 1  189171.453  .005274016503031338 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.598698
                   .00325984 .00999251   -.003569544869227898  -.004419544869227898 1  166226.058  .005133491013350546 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.607967
                   .00226935 .00999417   -.003652011382259613  -.004502011382259613 1  174025.714  .005552559410934224 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.637492
                   .00093202 .00999842   -.003367494319135485  -.004217494319135486 1  133643.145  .005733286333452386 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.694386
                   .00170281 .01000181  -.0037505884210459186  -.004600588421045919 1  183942.637  .007036022823492268 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.742396
                   .00257243 .01000407   -.005017137198260445  -.005867137198260445 1  162496.669   .00802747347828529 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.771292
                   .00192289 .01000971   -.004177577093186864  -.005027577093186864 1    88367.04  .009324343000147228 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  15.74883
                   .00118667 .01001325   -.002729201722832716  -.003579201722832716 1  107763.399  .007178063604187584 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.850378
                   .00117278 .01001367  -.0027513262408460793 -.0036013262408460794 1 1055072.226  .008102498532271952 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 15.995158
                   .00118011 .01001593   -.001497828965489124  -.002347828965489124 1   399690.91  .008451313664125139 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.055363
                   .00042599 .01002244  -.0007972371453842282 -.0016472371453842283 1   758818.84  .008152666439509269 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.152199
                   .00049391 .01002574  .00008850248085673883 -.0007614975191432612 1 1628571.155  .008110895478162924 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.318846
                   .00049975 .01002912  -.0003734912657474311 -.0012234912657474312 1 1699368.178  .007969462008870491 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.452682
                   .00025341 .01003202   -.001864598422557203  -.002714598422557204 1  941831.358  .008317854075448909 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  16.49576
                   .00016075  .0100331  -.0011780142779236977  -.002028014277923698 1  876366.873   .00941680091162802 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.580273
                   .00022027 .01003364  -.0006713045180746138 -.0015213045180746138 1  645812.255  .009150651563222478 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1  16.64694
                    .0003293 .01003475  -.0003640706224795169  -.001214070622479517 1 3183373.187  .009467478205013124 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.811977
                   .00022743 .01003801   .0004341224861915804 -.0004158775138084197 1 1359358.982  .009047265894811819 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.934553
                   .00041686 .01004053  -.0006446502716359517 -.0014946502716359517 1 1539686.219  .009237929100449165 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 16.984503
                   .00051512 .01004117 -.00012306210010084098  -.000973062100100841 1 1192090.474  .009697524459745635 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.068336
                   .00041387 .01004255  .00035730123440634587 -.0004926987655936542 1 3715758.297  .009960633168080418 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.208672
                   .00113756 .01004499   .0014846480267668438  .0006346480267668438 1 4211554.026  .009834785833022577 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.364716
                   .00120127 .01004428 -.00012506224535210365 -.0009750622453521037 1 3210055.549  .009977774011619058 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.404324
                   .00120127 .01004428                      .                     . 1 2198422.736  .009088695445233493 1.7 3.4166666666666665 88 1.02 134 .0029499846331112233 0 1 17.451433
                           .         .                      .                     . 1           .  .006950227800891668 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                           .         .                      .                     . 1           .  .010148632721320184 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                           .         .                      .                     . 1           .  .011566932873644126 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                           .         .                      .                     . 1           .  .011796189358193546 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                           .         .                      .                     . 1           .  .010809056199541882 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.03044248 .01004454                      .                     . 1           .   .00713030590223979 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.06292031  .0100368                      .                     . 1           .   .00838860696521819 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.02591407 .01001097                      .                     . 1           .  .008199895149133307 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                    .0024415 .01014231                      .                     . 1           .  .008972761118448457 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                   .00988509 .01013576                      .                     . 1           .  .009618872022821932 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00315705 .01013495                      .                     . 1           .  .008663047981018758 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00435281 .01009877                      .                     . 1           .  .008842305394127415 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00401596 .01009783                      .                     . 1           .   .00930575548541107 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00474879 .01010065                      .                     . 1           .  .010944248388203716 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00709537 .01009021                      .                     . 1           .  .010721913633803239 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00562055 .01009543                      .                     . 1           .  .011417425621086346 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00477055 .01007583                      .                     . 1           .  .011419572455144827 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00519502 .01007577                      .                     . 1           .  .011660872872807523 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00396137 .01006727                      .                     . 1           .  .010653974531842804 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00296342 .01006168                      .                     . 1           .  .012114751390161403 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00113821 .01007141                      .                     . 1           .  .010824098369776106 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00137897 .01007192                      .                     . 1           .  .012247284315993971 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00133876 .01007042                      .                     . 1           .  .013003922863556302 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00062465 .01006874                      .                     . 1           .  .013115024099098616 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  -.00047945 .01006483                      .                     . 1           .   .01334634557267867 1.7 3.4166666666666665 41  .96 378 .0030811387544215484 0 1         .
                  end
                  Thanks in advance!

                  Comment


                  • #10
                    Well, you can change the number of parameters you estimate by fitting a simpler model. I am at a loss to know what's puzzling there.

                    Comment


                    • #11
                      Given the fact that the only change between the first two regressions and the last two is the dependent variable I suspect something is wrong with those.
                      I conducted a rolling regression using the rangestat SSC function, but I want to try to do it using a rollreg SSC function. But to keep the results for the coefficients (the parameter I need for the following regression) of this regression I think I need to include a statsby SSC function. Is that correct? And how do I implement those two together that only the coefficient remains?

                      Thank you for all the help till now Nick Cox, you are a real life saver at the moment!

                      Comment


                      • #12
                        I can't be a life-saver at the moment because I don't clearly understand what you're asking.

                        The rollreg command (not function) is indeed from SSC but I've not used it in an age and my recollection is that it was superseded by rolling, which is part of official Stata (as is statsby, by the way).

                        Using something other than rangestat (also a command) would make sense if it didn't do what you want but you can combine interval() and by() options to get moving regressions for each panel.

                        Comment


                        • #13
                          With the rangestat command I used the interval command with it. What would the by() function add to that?
                          Can it be possible that a rollreg regression takes a long time to fullfill if you have a large dataset?

                          Comment


                          • #14
                            In rangestat (SSC) by() is an option, not a function. In examples like these, it specifies the panel identifier. interval() usually specifies a time or time-like variable.

                            Rolling regressions can certainly be slow in large datasets. Think how many regressions you're asking for.

                            Comment

                            Working...
                            X