Announcement

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

  • Compare distributions within a group, with distcomp

    I have the following dataset:

    Code:
    year   residuals
    2013    -.1820623
    2014    -.068333
    2015    -.1602945
    2016    -.3450584
    2017    -.4118948
    2018    
    2019    
    2007    
    2008    
    2009    .9428194
    2010    .4984708
    2011    .9822
    2012    1.107424
    2013    1.021672
    2014    1.126589
    2015    .5650554
    2016    .181492
    2017    .1412071
    2018    .2174679
    2019    -.0482616
    2007    
    2008    1.816428
    2009    
    2010    1.660056
    2011    1.603834
    2012    1.136881
    2013    
    2014    
    2015    1.052248
    2016    .9272207
    2017    
    2018    .6351303
    2019    .5296772
    I would like to check if the distribution of the residuals in a given year is different from another year. Therefore, I am running the following command:

    Code:
    distcomp residuals if year == 2007 | year == 2008, by(year)
    However, I get this message:

    Code:
    year takes on 1 values, not 2
    I do not understand why it is happening, because the same command worked with another analysis of residuals that I was conducting. Moreover, the variable year has more than one value.
    Last edited by Mateus Maciel; 01 Jun 2021, 16:21. Reason: distcomp

  • #2
    Never mind. Unfortunately, I only realized now that there were no observations for the year 2007.

    Comment

    Working...
    X