Announcement

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

  • sureg producing different results every time I run program

    Hi all,

    I am wanting to estimate seemingly unrelated regressions (SUR). I know of two commands that are designed for such estimation: sureg and xtsur, where sureg is designed for balanced panels and xtsur fit for unbalanced panels. Please let me know if I'm incorrect here.

    I am working with an unbalanced panel dataset that looks at different product prices (chocolate, chips, and candy). I tried balancing it by keeping only the dates where chocolate!=. & chips!=. & candy !=. . In other words, the dates where prices for all three products are observed. Then comes my problem: every time I run my code, the sureg parameters are different.


    I should note that I only have one dependent variable (price). I separate price, by(product) and this lets me run the code, but again the results are different each time I hit 'do.' Any suggestions as to why this may be?


    P.S. I have tried using xtsur with some success, but I am required to average all my series at the daily level in order to have dates that don't repeat (and xtset the data). Averaging obviously greatly reduces my observation count, which I do not want.


  • #2
    See what my dependent variable data look like below. These are individual product transactions that I then merge with my independent variables (income per capita in the region, shipping rates, etc). I have independent variables that are defined for each product (e.g., income_candy, income_chocolate, income_chips) that I regress on.

    So my code looks more or less like this: sureg (price_candy log_time_candy income_candy bulk_purchase_candy shipping_rates_candy) (price_chocolate log_time_chocolate income_chocolate bulk_purchase_chocolate ) (price_chips log_time_chips income_chips bulk_purchase_chips shipping_rates_chips)


    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float(price_candy price_chocolate price_chips price_date)
      2.995732   4.892852 -1.2039728 19360
     2.0794415  1.2039728   .4054651 19361
     3.6888795   5.703783  -.4054651 19389
      .9162908   6.838762   .6931472 19398
      2.995732  4.4228487          0 19412
      3.178054   6.214608  1.7917595 19444
     1.7917595   .8675005   .6931472 19446
      .9162908   5.298317   .2876821 19454
      .6931472  3.3242364  -.9808292 19479
     1.0986123  2.4079456          0 19484
      .3364722   1.609438   .6931472 19535
      1.609438  2.4079456          0 19549
      2.014903   2.631089  1.3862944 19584
      2.995732   2.995732          0 19590
     2.0794415   5.298317  -.4054651 19593
             0  1.7837913   .4054651 19649
     1.0986123   1.966113  .06062462 19652
      1.609438   5.298317   .6931472 19658
             0  3.3242364 -.18232156 19666
      1.609438  2.4079456 -.51082563 19678
     2.3025851    6.50229  1.3862944 19687
      .6931472   6.907755  -.6931472 19753
       1.94591  2.3025851          0 19776
      2.484907  2.1202636   .1541507 19790
      .6931472  4.7105308          0 19794
      .6931472    6.55108  -1.609438 19795
     1.3862944   3.170086          0 19796
      3.465736   2.748872  1.3862944 19801
     3.6888795   2.748872          0 19803
      .9162908  2.1892564  1.3862944 19810
      1.609438    6.50229  -.9162908 19813
     1.7917595   5.298317          0 19821
     1.7917595   5.585999          0 19824
     1.3862944   .6751287  -.6931472 19827
     3.6888795  4.6051702  1.3862944 19829
      1.609438   2.525729          0 19837
      .6931472   5.585999          0 19841
      1.609438   6.279147   .6931472 19842
      1.609438   3.660709 -.22314355 19845
      2.525729  2.1202636  .18232156 19849
     1.7917595   .6931472          0 19851
      2.995732   3.912023 -.22314355 19879
     1.0986123   3.506558  -.6931472 19882
     2.3025851   5.809143  1.6486586 19883
     1.3862944   3.912023          0 19886
      2.944439   6.907755  -.2876821 19891
      .9162908   .1743534   .2876821 19893
             0  4.6051702  1.3862944 19894
      1.252763   .1743534  1.3862944 19918
     1.0986123  4.6051702  1.1631508 19919
     1.0986123   6.279147          0 19924
     1.0986123  3.3242364          0 19928
      .6931472   5.298317          0 19951
      .6931472 -4.4308167          0 20016
             0   6.907755   .6931472 20024
     2.3025851    1.89712  -.6931472 20041
      1.609438  1.8325815 -.51082563 20092
     1.0986123  4.1351666  -.4054651 20184
     1.3862944  1.3664917   .2876821 20205
     1.0986123   3.218876  -.4054651 20227
     2.3025851  1.5896353  1.2669476 20229
     3.3322046   3.624341 -.18232156 20241
      .6931472  1.7837913          0 20245
      .6931472  3.8066626  -.6931472 20247
     1.7917595   3.506558          0 20248
      .6931472   2.525729  -.2876821 20280
     4.6051702   2.525729  -.3566749 20285
      .6931472  2.2827826  -.4054651 20302
      .9162908  1.7837913          0 20306
      2.995732   3.218876          0 20318
     1.3862944  4.1351666 -1.0498221 20320
             0  1.7837913          0 20327
     2.3025851  -.9242589   .1541507 20343
     2.3025851   4.317488  -.9162908 20344
      1.609438   2.525729   .8754687 20365
     1.7917595   1.609438  1.7917595 20387
      1.609438   1.654174   .6931472 20388
       1.94591  2.2827826          0 20389
     .10436001  .46203545 -.10536052 20396
     1.0986123   1.482686          0 20398
     1.3862944   3.085344  -.9162908 20399
      1.252763  1.9261075 -.18232156 20402
      2.995732  1.0788096 -.22314355 20405
     1.3862944   1.609438  -2.995732 20409
      .9162908  1.7837913          0 20439
     1.3862944   5.521461  -1.609438 20470
      .6931472  4.1351666          0 20471
      2.014903   2.253795          0 20503
      .4054651   3.912023  -1.609438 20511
      .9162908   3.170086   .2876821 20519
             0  1.5896353  -.6931472 20520
      .9162908   4.787492 -.22314355 20526
      1.609438   3.218876  -.6931472 20529
      1.609438  4.6051702  -5.521461 20542
     1.0986123  1.5896353  -.2876821 20549
     1.3862944  2.2827826 -.22314355 20553
      .6931472  4.6051702   .2876821 20564
      .6931472   4.199705 -.51082563 20568
     .22314355  2.2827826          0 20570
    -.22314355  3.6888795   .2876821 20572
    end
    format %tdnn/dd/CCYY price_date

    Comment


    • #3
      Lucas:
      your data example does not allow to replicate your equations.
      In addition, while the comminity-contributed module (as you're kindly requested to mention it for good reasons detailed in the FAQ) -xtsur- was actually developed for dealing with unbalanced panel datasets, -sureg- was oroginally developed for regression equations sharing the same regerssand.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X