Announcement

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

  • t-test of the difference of regression coefficients between two regressions

    Dear Statalist community,

    I am encountering the following issue and I hope you can provide some well-appreciated support.

    I have a panel dataset with years, firms (PERMNO), a dummy variable (SINDUM) equal to 1 if the stock belongs to a sin industry, the share of institutional ownership by different institutions type (IO_Group1 and IO_Group2), and a series of firms characteristics.

    Please find below an extract of the dataset:
    Code:
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input float year double PERMNO float(SINDUM IO_Group1 IO_Group2 NASDAQ avg_monthly_ GDUM Industry_Group ln_mktcap std_ret PRINV Ind_Beta) byte SP500
    1980 10006 0    .2288849   .10688472 0    .03520581 0 25  12.93462  .01899269  .02173913 1.3557777 1
    1980 10057 0    .3458411   .13607116 0   .011569367 0 21  11.59875 .025129836  .03921569 1.1703357 1
    1980 10137 0     .149071 .0039786734 0   .001860543 0 31 13.224848 .014465132  .07272727  .6062865 0
    1980 10145 0    .3023002  .071859464 0   .014321812 0 14  14.24181  .02213571  .01869159 1.0285842 1
    1980 10153 0   .22167355    .1131937 0   .013583386 0 21  13.02376 .016671631  .02749141 1.1703357 1
    1980 10161 0   .13648039   .02537558 0   .001627064 0 28 14.755895 .021482565 .024242423 1.2662623 1
    1980 10225 1     .135169  .016797788 0   .019444404 1  5 13.793976  .01143477 .012903226  .6315187 1
    1980 10233 0     .372721   .12323527 0   -.02320379 0 32  13.53831   .0195707 .037209302  .3326351 1
    1980 10241 0   .10267988  .034972455 0 -.0044535324 0 39 13.283033 .012843922  .03292181  .7644835 1
    1980 10321 0   .03000632  .002938957 0   -.03787826 0 23  12.30493 .031573396   .2580645  .8140485 1
    1980 10364 0   .09908443   .02024025 0   .032141432 0 19   14.0629  .03956298 .023121387 1.2283193 1
    1980 10372 0   .25515106   .05919303 0    .02286302 0 21 13.797174 .013786243  .03041825 1.1703357 1
    1980 10400 0  .009795918           0 1    .03475175 0 41  9.108792  .03565637  .13559322 1.1439214 0
    1980 10401 0   .14741868  .012320025 0    .00161488 0 32 14.539044 .010529038  .02088773  .3326351 1
    1980 10460 0   .13018975  .009051168 0    .03090043 0 37 12.632612  .02750598  .03187251 1.3969642 0
    1980 10479 0   .12789172  .019240994 0    .02890133 1  2 12.258307  .02982669  .04255319  .7133265 1
    1980 10487 0   .17158444   .07714452 0    .01973763 0 19 13.051404  .02242192 .023188407 1.2283193 1
    1980 10516 0    .3434802    .0592393 0   .025506524 1  2 14.313866 .028647194 .026936026  .7133265 0
    1980 10559 0     .327504   .10640749 0   .022181774 0 42 12.710895  .01896831  .04081633    .91574 1
    1980 10604 0    .3860586   .05507669 0    .04859649 0 30 16.531906 .022199374 .015717093 1.1877681 1
    1980 10640 0   .09296254  .004157208 1    .08638733 0 37  10.62051  .03933501   .0860215 1.3969642 0
    1980 10656 0   .03767383   .03180561 1   .014107432 0 49  9.632171 .010118206  .07017544  1.238279 0
    1980 10672 0           0    .0448895 1  -.023886714 0 17  9.069698 .027649453  .16666667 1.1980772 0
    1980 10698 0   .13901506  .016242187 0    .03283859 0 30 12.078012 .017308839  .01509434 1.1877681 0
    1980 10727 1  .005720453           0 0   .035985466 1  5  9.679226   .0213405  .11594203  .6315187 0
    1980 10743 0           0  .003733109 0  -.005270798 0 16   9.92868  .02297878  .17391305 1.0005699 0
    1980 10751 0   .19257134   .02095622 0    .04130324 0 24 14.118132  .02094786 .016949153  1.431364 1
    1980 10752 0   .02648987   .04021057 1   .020439854 0 12 10.711892 .032713477  .07476635  .9244894 0
    1980 10779 0    .5140238           0 1    .10454148 0 35  9.906508 .034979694  .03773585  .9750789 0
    1980 10786 0   .13862191   .06813726 0     .0279367 0 19 13.957016 .019081216  .03791469 1.2283193 1
    1980 10787 0  .006479907   .04793885 1   .033959404 0  8  9.933241  .02632722  .08333334 1.0014412 0
    1980 10823 0  .032008037  .006361618 0   .004966514 0 31  12.01707  .01512574  .04733728  .6062865 1
    1980 10866 0    .1997315    .0441126 0    .02527296 0 10  12.50855 .014973982 .032258064  .9145566 1
    1980 10874 0    .1337839   .05887731 0     .0229719 0 21  12.65497  .02592051  .06451613 1.1703357 1
    1980 10875 0  .004023346           0 1    .05884353 0 17 10.068825  .04117799  .14159292 1.1980772 0
    1980 10890 0    .4020038  .064274974 0   -.02644129 0 35 14.620357  .01890795 .018561484  .9750789 1
    1980 10989 0    .3065874   .04960364 0   .009682855 1  2  14.15572 .015389995 .015873017  .7133265 1
    1980 11017 0  .006807738 .0019411397 0     .0380074 0 27 11.905925  .04505499  .03960396 1.1383986 0
    1980 11105 0   .15503293   .03646003 0  -.007387604 0 17 11.996092 .017085526  .08333334 1.1980772 0
    1980 11157 0  .002508781           0 1    .04654696 0 37 10.659618 .006322898  .09356725 1.3969642 0
    1980 11164 0   .17500204  .018895254 0  -.009026975 0 21 11.419044  .01738633  .05369128 1.1703357 1
    1980 11260 0 .0028749795 .0004154659 0 -.0030215334 0 23 12.696165  .04023177   .2051282  .8140485 1
    1980 11295 0   .07254504  .028578514 0   .006236329 0 10 11.341835  .02428242  .10526316  .9145566 1
    1980 11308 0    .3258814   .04584682 0  .0046009556 1  3 15.213576 .015473415 .029962547 .58990544 1
    1980 11332 0   .27467763   .05948355 0    .01093607 0 21 13.289512 .016478788  .02209945 1.1703357 0
    1980 11340 0   .10447034  .030435145 0   .013512406 0 31 14.103334  .02054711  .02484472  .6062865 1
    1980 11404 0   .08397447   .02519654 0    .01342228 0 31 14.264595  .01247805    .040201  .6062865 1
    1980 11447 0   .31437185  .034816056 0   .018418683 0 39  13.88369 .014768132  .03065134  .7644835 1
    1980 11471 0    .3244238    .0497019 0   .035637364 0 30 15.770602  .02034548 .015296367 1.1877681 1
    1980 11498 1   .02226657  .014267047 0    .04906895 1  5 11.768157 .015224093  .02173913  .6315187 0
    1980 11587 0  .005791666           0 1    .05213537 0 49 10.641847  .01424542  .02580645  1.238279 0
    1980 11607 0    .2693792   .03876031 0  -.006845783 0 23 13.517178  .02187751  .04678363  .8140485 1
    1980 11674 0   .04058303  .001696863 0  .0017864225 0 31 13.725431 .012353851  .09195402  .6062865 1
    1980 11690 0     .042083  .008780142 0    .06204396 0 27 14.327272  .03193229 .011627907 1.1383986 1
    1980 11691 0   .08878569  .010914394 1   .030340254 0 40 11.944098 .021991987 .031189084 1.3212353 0
    1980 11703 0    .4433838  .034620985 0    .01094536 0 14 15.637827 .017423743 .023809524 1.0285842 1
    1980 11754 0    .3746806   .04556205 0    .03681411 0  9 16.017841 .018192044 .014336918  .8329948 1
    1980 11762 0    .2633958   .02854686 0   .015950628 0 23  13.40209 .018339556  .03508772  .8140485 1
    1980 11790 0  .004069176  .011427603 1   .011539298 0  1 11.187895 .017994316 .027210884 1.3562742 0
    1980 11798 0           0  .003892565 1   -.05473204 1 43  7.786734  .05728691  1.0666667 1.2091174 0
    1980 11843 0   .01649282  .007734889 1     .0500026 1  3  9.895613  .02707507  .16842106 .58990544 0
    1980 11850 0    .3402529  .030187305 0    .04156378 0 30 17.366177 .015448513   .0124031 1.1877681 1
    1980 11851 0   .09629323           0 1   .001539781 0  6  9.010852 .009273169 .062992126 1.2298396 0
    1980 11981 0   .12308236   .04124983 0   .036330123 0 28 14.469102 .030749535 .016427105 1.2662623 0
    1980 11982 0    .1621101  .010452962 1   -.02659742 0  8  9.340518 .036482867  .12598425 1.0014412 0
    1980 12036 0    .4441433   .05837377 0   .011316582 0 25  12.99981  .02091528 .026936026 1.3557777 0
    1980 12044 1  .027047006           0 0    .03105042 1  5  10.10962  .02702507  .09756097  .6315187 0
    1980 12052 0    .1763499    .0796245 0    .03761153 0 25 14.378284 .024514707 .023391813 1.3557777 1
    1980 12053 0    .1891945           0 1   .035487745 0 22  8.006368  .05789838          2  1.118277 0
    1980 12060 0     .362441   .03432566 0    .02249976 0  9 16.451033 .014163077  .01632653  .8329948 1
    1980 12079 0   .22019586  .015457222 0 -.0016229085 0 23  16.11358 .018304061  .02222222  .8140485 1
    1980 12087 0   .01917272  .005147446 0   .004702657 0 17 10.493522 .029231356  .10526316 1.1980772 0
    1980 12095 0    .3299649   .08599636 0    .02072519 0 36 14.044875  .01901917  .02234637  1.253005 1
    1980 12140 0   .15066363   .04618109 0   .027802264 0 23 12.917225  .01870747    .040201  .8140485 1
    1980 12240 0  .013944694   .02758804 1    .10249539 0 30 12.680927  .04524416  .02631579 1.1877681 0
    1980 12319 0    .0786549  .016833412 0    .07253741 0 27 13.923724  .03356334 .015267176 1.1383986 1
    1980 12320 0    .1987866           0 1   .002735733 0 19 10.100451 .015694693  .06060606 1.2283193 0
    1980 12431 0     .356707   .06134998 0    .03973299 0 21 13.688076 .016748827 .013355592 1.1703357 1
    1980 12458 0   .24621876   .06450309 0  -.002574567 0 19 13.283525 .012811655  .03587444 1.2283193 1
    1980 12459 0   .11824594           0 1   .004825927 0 28 10.823412 .005209485  .04545455 1.2662623 0
    1980 12490 0    .3562971   .04096076 0   .010771302 0 35  17.41049 .018079361 .014732965  .9750789 1
    1980 12503 0   .12865199  .034378815 0  -.024339056 0 21 13.611733  .01915895  .03902439 1.1703357 1
    1980 12511 0   .25340647   .10912268 0     .0547875 0 14  14.38579  .01820992 .015267176 1.0285842 1
    1980 12570 0    .3097533   .04685846 0   .022912564 0 36  11.76219 .015693892 .033333335  1.253005 1
    1980 12626 0    .3538216   .05292915 0   .030371826 0 42 12.870483 .016360428  .02919708    .91574 1
    1980 12650 0   .06134988   .17173077 0    .05579203 0 40  8.900996  .02359761  .02056555 1.3212353 0
    1980 12678 0           0    .4309552 1  .0030377905 0 17  6.132584  .02839451   .5714286 1.1980772 0
    1980 12706 0   .11446616  .016173422 0 -.0019752902 0 19 13.702887  .02906193 .037209302 1.2283193 1
    1980 12749 0    .4085252   .05668703 0  -.016803246 0 42 14.602016  .01987743  .05594406    .91574 1
    1980 12781 0   .05295966           0 0   .029104417 0 31  11.54322 .017218512  .04232804  .6062865 0
    1980 12888 0   .15439856   .08318196 0   .018656494 0 17 12.758694 .017809704 .031128405 1.1980772 1
    1980 12918 0   .02397408    .0125054 1   .006797479 0 49 10.242435  .02050053  .08247422  1.238279 0
    1980 12976 0    .3814954   .06640474 0    .02104654 0 42  13.42747 .015614232  .02352941    .91574 1
    1980 13012 0  .007145396   .00934945 0   .013054528 0 10  9.905617 .031440463  .14035088  .9145566 0
    1980 13040 0  .004122826           0 1 -.0016724152 0  9  9.461298  .01717139   .2191781  .8329948 0
    1980 13047 0    .3609653   .05366412 0    .04056722 0 30    15.264  .02578407 .014134276 1.1877681 0
    1980 13056 0   .29032695    .1001764 1   .003421556 0  8 11.859006   .0125617  .08648649 1.0014412 0
    1980 13100 0   .28202957    .0743167 0   .015812986 0 42 13.439666 .016292864  .03773585    .91574 1
    1980 13119 0   .21631366  .018596794 0   .005810721 0  9 12.755242 .017415883  .04123711  .8329948 1
    1980 13143 0   .02271703 .0001588591 0  -.034423802 1 43  12.45789 .032823723       .125 1.2091174 0
    end

    I am running the following two regressions to define the effect of being a sin stock on the share of institutional ownership of each institution's group, and I now want to test if the coefficient in front of SINDUM is significantly different between the two regressions (-0.0211182 for group1 vs. -0.0110016 for group 2).

    Code:
    moulton IO_Group1 SINDUM GDUM ln_mktcap Ind_Beta PRINV std_ret avg_monthly_ NASDAQ SP500, cluster (Industry_Group_str) moulton
    
    moulton IO_Group2 SINDUM GDUM ln_mktcap Ind_Beta PRINV std_ret avg_monthly_ NASDAQ SP500, cluster (Industry_Group_str) moulton








    What I need to perform is a t-test of the difference of coefficients in from of SINDUM. However, I am not sure how to properly do that and I did not find clarity reading related posts in the forum and additional material.
    Any help on how to proceed will be extremely appreciated.
    Thank you so much in advance!

    Marco

  • #2
    I have no idea what commands you are using (moulton?) but the general idea is described here: https://www.statalist.org/forums/for...ression-models
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      Marco:
      just like Felix, I do not know what Stata (official or community-contributed) you used; the onlt mention of Moulton I've found out is reported in -clan- from http://fmwww.bc.edu/RePEc/bocode/c.
      In addition to the recent thread Felix pointed you to, you may want to take a look at https://www.stata.com/support/faqs/s...-coefficients/.
      In addition, is usually not a good idea to perform two different regressions when you can easily avoid it.
      If you're interested in the potentially different effects of Group 1 or 2 on -SINDUM- (or the other way round), you can simply interact these predictors via -fvvarlist- notation:
      Code:
      i.Group##c.SINDUM
      However, this approach requires that Group 1 or 2 are two levels of the same categorical variables (ie, -long- format).
      Last edited by Carlo Lazzaro; 07 Jan 2022, 11:45.
      Kind regards,
      Carlo
      (StataNow 18.5)

      Comment

      Working...
      X