Announcement

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

  • time-invariant moderator (interaction) in quadric regression fe model

    Hello everybody

    I'm currently writing a paper about the effect of the Corporate Social Responsibility Score on the Return on Assets of firms. The main relationship is found to be inverted U-shaped. Now I want to investigate the influence of some moderators. One of them is the time-invariant variable consistency which describes the consistency of a firms CSR-action and is measured by the kurtosis of the firms CSR-Score over time, there fore consistency is the same for a firm in every year.
    As we have a fixed effects model (suggested b Sargaa-Hansen-Test, used instead of Hausmann-Test because we have autocollinerarity in our data), we wondered how to investigate the moderating effect of consistency in pur quadric regression model. I found other forum-posts were was stated, that it doesn't matter if the moderator itself gets omitted because of collinearity as long as we got values for the moderating-effect/interaction effect.

    The latest code looks like this:
    xtreg roa c.csr_score##c.csr_score##c.consistency ln_firmsize ln_adi ln_rdi slack lev_w industry_growth industry_concentration i.fyear, fe cluster(cusipnr)
    where:
    roa = return on assets, dependent variable (time variant)
    csr_score = CSR score, independent variable (time variant, continuous)
    consistency= moderating variable (time-invariant, continuous)

    we also inserted some control variables in our model which are the other variables.

    with this code we get the following results:

    Click image for larger version

Name:	Bildschirmfoto 2022-12-27 um 15.06.21.png
Views:	1
Size:	218.5 KB
ID:	1695054









    is this model appropriate to investigate an interaction effects between a time variant and a time-invariant variable?

    As we are hypothizing for a quadric (inverted u-shape) relationship, which row of interaction terms do we have to interpret? Obviously both are not statistically significant with very low coefficients, but it would be just nice to know which values have to be used for interpretation.


    Hopefully there is somebody out there who can help out, we would be so thankful! If there is any needed information missing, please let me know.

    Many thanks in advance,
    Louisa

  • #2
    Yes the code and results are appropriate to your model. Whether your model is fit for purpose is a substantive question, about which I lack the expertise to offer an opinion. But this is how you code the interaction between a continuous moderating variable and a quadratic continuous variable.

    As for interpretation, because of the interaction you are not actually hypothesizing a quadratic relationship. You are hypothesizing many quadratic relationships between roa and csr_score, a different quadratic relationship for each value of the consistency variable. Interpreting such a model is fairly complicated and doing it from the regression output directly requires a lot of tedious and error-prone calculations. For that reason, I suggest you use the -margins- command. First you have to pick out series of values for the csr_score and consistency variables that span the interesting range of those variables. As I have no sense of how these variables run, let me assume that for csr_score a good set of values would be 0 10 20 30 40 50 and that for consistency a good set of values would be 2 4 6 8. Then after running your regression you would run
    Code:
    margins, at(consistency = (2(2)8) csr_score = (0(10)50))
    marginsplot, xdimension(csr_score)
    The table in the margins output and the graph from -marginsplot- will show you the expected values of roa as functions of csr_score, at the different values of consistency. It is often also helpful in this context to look at the marginal effects of csr_score conditional on csr_score and consistency. Those would be:
    Code:
    margins, dydx(csr_score) at(consistency = (2(2)8) csr_score = (0(10)50))
    marginsplot, xdimension(csr_score)

    Comment


    • #3
      Hello Clyde,

      many thanks to you for your fast response! This helps a lot Do you know if there is any literature which states that it's appropriate to use a fe model with a time invariant moderating/interacting variable?

      Thank you as well for the codes for the graphs, great! Unfortunately I tried the following (adjusted your code to our data)
      margins, at(consistency = (-4(2)4) csr_score = (0(20)80))
      marginsplot, xdimension(csr_score)
      but state was not able to put the predicted values out, as you can see here:
      Click image for larger version

Name:	Bildschirmfoto 2022-12-28 um 18.29.53.png
Views:	1
Size:	97.7 KB
ID:	1695185



      do you have any idea what could have gone wrong? (Of course I ran the regression directly before using the margins code)

      I tried the code with another regression using a time variant moderator and it worked pretty good.

      Very thankful for any help Best regards

      Comment


      • #4
        To try to diagnose the non-estimability problem you are encountering, I need to see example data (use the -dataex- command for that) as well as the exact regression command and the exact and complete regression output you got. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

        I can't think of any references that talk about the acceptability of such models. There are plenty of papers out there using them. In fact just about any paper that looks at effect moderation in panel data will have done this. I'm sure you can find several of those in your field easily.

        Comment


        • #5
          Hello again and thank you for the answer, so I tried to prepare some example data and the regression, I hope this is sufficient.

          We have a panel data set with different firms (cusipnr) and years. roa is the variable for return on assets, csr_pace, relatedness and consistency are the moderating variables which we would like to investigate. The other variables are the control variables.

          Code:
          * Example generated by -dataex-. For more info, type help dataex
          clear
          input long cusipnr int fyear float(roa csr_score csr_pace relatedness consistency ln_firmsize ln_rdi ln_adi slack lev_w industry_growth industry_concentration)
           2 2015    .19638057  17.06594          .   4.316243   2.736909  5.450412  -3.435509  -5.275619          0          0  .8972727  .5207492
           2 2016    .20806924 18.633266          .   4.316243   2.736909  5.547246  -3.062339  -5.214351          0          0 1.0325423  .4491171
           2 2017    .18363097 19.130655          .   4.316243   2.736909  5.692991  -3.128042  -5.141984          0          0 1.0667765  .4664789
           2 2018    .13813242 24.212416   5.935795   4.316243   2.736909  5.730739 -3.1280496  -6.002548          0          0 1.0312803  .4377039
           5 2015    .04397461  50.32922 -16.514132   4.810818 -2.1841028  7.577327 -4.5815945  -2.782363   .3688441  1.2396765         .         1
           5 2016    .04625817  54.46924          .   4.810818 -2.1841028  7.632643  -4.588121 -2.9312544   .3040446   .9823621  1.030919         1
           5 2017    .04705083  57.19421          .   4.810818 -2.1841028  7.937053  -4.780053  -3.193862   .3176735  1.2044955 1.2515575         1
           5 2018    .03829314  69.11864          .   4.810818 -2.1841028  7.932506 -4.7628202  -3.273795   .3025409   1.117513  .9961001         1
           5 2019    .03829879 74.217224   13.95653   4.810818 -2.1841028  7.933295  -4.851385  -3.344254   .3109087  1.1916764 1.0074697         1
           5 2020   .020336537  73.47199   8.916965   4.810818 -2.1841028   8.02247  -5.041852  -3.427351   .3710106  1.6563888  .8463466         1
           5 2021   .032963477  73.92408   7.917933   4.810818 -2.1841028  8.036347  -4.755436   -3.27076   .3374308   1.284112 1.2235985         1
           8 2017    -.4051047 12.490838          .          .  1.7463065 4.6823072  -2.852931  -5.193133  .39780965  1.0654055 1.6981722  .1915441
           8 2018     -.739716  14.49408          .          .  1.7463065  4.487242  -3.119621  -4.710386   .4972546  2.2369246  1.307601  .2294221
           8 2019    -.3798774 14.745724  1.1204895          .  1.7463065  4.844903 -3.9930444  -4.844903   .6648858   3.234834  1.304022 .22279187
           8 2020    -.3647513 13.859795 -.05041949          .  1.7463065  5.335965 -3.5598266  -5.240654   .4685395  1.1067435 1.2673837 .24075544
           8 2021   -.25935647 13.890784          .          .  1.7463065  5.621317 -4.3276863  -5.284845   .3704177   .7290346 1.2333057    .39117
          14 2007     .0514454 12.221898  -42.10529  4.1329384  3.1969914  8.473784  -3.431005 -4.5129714  .06142953   .3410671 1.1477077   .418588
          14 2010     .0405562  31.85556          .  4.1329384  3.1969914  8.600965 -3.2091565 -4.6231537  .08148026  .27008727         .  .4025807
          14 2011    .08037535  41.66358 -11.722534  4.1329384  3.1969914   8.88975  -3.270799 -4.6955595  .19424845   .4907185 1.1772008  .4139956
          14 2012   .067613766  54.56546  -5.312147  4.1329384  3.1969914  8.951803 -3.1925855  -4.777415   .1341138    .371403 1.0797285  .4252602
          14 2013    .07076836  54.83744   15.31076  4.1329384  3.1969914  9.040595  -3.172995  -4.937952   .1112125    .311755 1.0878597   .411657
          14 2014     .0554902  51.78242   2.834122  4.1329384  3.1969914  8.908681  -3.088598  -4.817676  .13488555   .3166304  .9550692   .417706
          14 2015    .04097642  49.42811          .  4.1329384  3.1969914 8.7797575  -3.137141  -4.849895  .14286374   .4351196  .8619233  .4121684
          14 2016   .022334134  50.15047  -2.856758  4.1329384  3.1969914  8.877438 -3.1867404  -5.031555  .22459684   .6107128 1.0579144  .3479807
          14 2017   .023382716  56.62341   8.602795  4.1329384  3.1969914  8.983653  -3.205691  -5.231799  .20298053   .5655862 1.1066555  .3452723
          14 2018    .03743575  50.61585 -.18208694  4.1329384  3.1969914  8.939371   -3.06669  -5.194584  .16722177   .4976304 1.1307391 .54856783
          14 2019   .016134644  56.16477   4.390232  4.1329384  3.1969914  8.956699  -3.117803  -5.211912   .1742851   .5440465 1.0503434 .56095743
          14 2020    .05022224  56.20768  3.3555744  4.1329384  3.1969914  9.048315  -3.211752  -5.235008  .16373086   .6035571  .9805646  .5339019
          14 2021    .09769008  74.03995          .  4.1329384  3.1969914  9.125011  -3.119151   -5.13233   .1669226   .4893879 1.2536585  .6083341
          23 2016 -.0010018456   25.9221          .          . -.28325605  7.815379   -5.06478  -5.018098   .3895032  1.0557926 1.2824277  .1739138
          23 2017   -.10750277  25.16907          .          . -.28325605  7.524689  -2.576908 -4.4023237   .3964325   .9296913 1.0908631  .1730324
          23 2018   -.05594496  22.35269          .          . -.28325605  7.069414  -2.721125 -3.6749055  .22283468   .3793037   1.62485 .17692553
          23 2019   -.59105796 18.387827  -6.093458          . -.28325605  6.673585 -1.7340232 -2.6976485   .3751452  1.0753567 1.3181446  .1778406
          33 2016    .04442384 28.129354   8.567928 -1.5388618   -.303599  5.688726 -2.6636295  -.4065384   .1590433   .3254599  1.233927 .16190542
          33 2017  -.070279196  24.18009   7.307666 -1.5388618   -.303599  7.291153  -3.421892  -1.648183   .1774114  .27671626 1.2767423 .15090197
          33 2018    .04276374 17.196304          . -1.5388618   -.303599  7.499991  -3.386776  -1.686757  .13605218   .1978276 1.2535667  .1441372
          33 2019   .018124895 15.264187          . -1.5388618   -.303599  7.560919  -3.398916 -1.3782147   .1828263  .28784028 1.2603662  .1474435
          33 2020   -.00265309  18.15678          . -1.5388618   -.303599  7.769878 -3.5386305 -1.5803823   .3445056   .6535868 1.1554825 .15121265
          33 2021  -.035508953     19.24    .359808 -1.5388618   -.303599   7.60596 -3.3442245 -1.2844726  .29001695   .5288762 1.2179762 .24604855
          34 2010   -.26415285  31.76407          .   2.793515  -2.123696  7.993721 -4.2584352  -3.620483 .017182596  .03764922         .  .3455047
          34 2011  .0046371683   49.0158          .   2.793515  -2.123696  7.946264  -3.904968 -3.6037576  .02343363   .0509988  1.265931  .3267821
          34 2012       .37479  39.18911  -3.914822   2.793515  -2.123696   7.93641  -4.134202  -3.484391  .02012655  .04952995 1.1824448  .2841207
          34 2013   .030971376   37.0914  -2.736967   2.793515  -2.123696  8.000819  -4.297051  -3.880157  .01883757  .04927434 1.1625855 .24832855
          34 2014   .036336284  48.53192          .   2.793515  -2.123696  8.148041 -4.5210366  -4.242036  .11502632   .1891677  1.198014  .2193918
          36 2017  -.063374825  21.70317          .  -1.936413  1.3215555  5.827253 -3.8957314  -5.296625   .3642219  1.1088784         .  .6969197
          36 2018   .026118876 27.356094   3.058881  -1.936413  1.3215555   5.82811 -3.6998785  -5.086173   .3092583    .906772  .9799531   .710729
          36 2019   .008302194  26.38933          .  -1.936413  1.3215555  5.894835  -3.664821  -5.307049   .3478991  1.0774859 1.0995514  .6599063
          36 2020    .01791349  27.25223  1.0707105  -1.936413  1.3215555  5.844813  -3.898903  -6.201488   .3278157   .9680838  .6197662  .7445267
          36 2021   .028219223 24.799137          .  -1.936413  1.3215555   5.78074  -3.924442  -6.291566  .27585888   .7444744  .9403766         1
          40 2005   .032863658  38.51499  -27.69521   .5995823  1.1845474 11.888838  -7.021304  -5.189338  .17932186   .5589687  .8448224  .3364634
          40 2006    .02718062 36.198936   -31.2052   .5995823  1.1845474 12.508523  -7.101351  -5.175499  .18498415  .51753503 1.2136565  .3446204
          40 2007    .04335665  49.87153   -5.77181   .5995823  1.1845474 12.526865  -5.634224   -4.38655  .20771357  .55574816  1.522356  .5932505
          40 2010    .07398468  67.79414  16.114553   .5995823  1.1845474 12.500562  -5.296412 -4.4978676   .2196411   .5926447         .  .5106827
          40 2011    .01458882  69.01931          .   .5995823  1.1845474  12.50745  -5.419877 -4.7414575  .22674814   .6135747 1.0117916  .5129313
          40 2012    .02667499    69.352   3.460953   .5995823  1.1845474 12.514715  -5.361663 -4.5388064  .24368103   .7561985   1.01422 .51748633
          40 2013    .06569422 70.215576  12.860456   .5995823  1.1845474  12.53461  -5.229422 -4.4426765  .24943572   .8219545  .9830278  .5302172
          40 2014   .021254726  66.51443 -1.3213755   .5995823  1.1845474 12.587344  -5.131467 -4.4941874   .2595747   .9501795  .9574131  .5604888
          40 2015   .033141118  66.34599   2.721413   .5995823  1.1845474 12.905878   -5.47162 -4.7083387  .29432145  1.0283686 1.0473092  .5747091
          40 2016    .03213305   59.5466          .   .5995823  1.1845474 12.908727  -5.500803 -4.6744275  .28151333  1.0030698 1.0354123  .5980662
          40 2017    .06631434  61.76279  4.1198106   .5995823  1.1845474 13.003798   -5.68858  -4.768438  .28365874  1.1667247 1.0763835  .5703876
          40 2018   .036419086  63.51772          .   .5995823  1.1845474 13.184143  -6.099079  -4.647147   .3125799   .9588025  .9928784  .8487262
          40 2019   .025201706 66.652245  10.593143   .5995823  1.1845474 13.220703  -6.069218 -4.5012226   .3137987  1.0226955 1.0070066  .8545038
          40 2020  -.009844777  67.80942    3.78154   .5995823  1.1845474 13.172602  -6.074226 -4.6060476   .3347091  1.1318154  .9886045  .8362852
          55 2013    .14137955  43.46735   -33.2762   5.334289  2.3503118 10.281856 -2.2131393  -3.842505   .4894856  3.2776046 1.1086869 .26778266
          55 2014    .06439903  59.38638  -5.682236   5.334289  2.3503118  10.22365 -2.0214405  -3.723862   .3835263   8.617106 1.3551962 .27578223
          55 2015    .09696513  65.13353   6.844884   5.334289  2.3503118  10.87899  -2.481707 -4.3222117  .55117816   8.028137 1.1579565  .2917908
          55 2016    .09006187  72.01221    12.4185   5.334289  2.3503118 11.098908  -2.672516  -4.460341  .55129427   7.946937 1.1767914 .20782527
          55 2017     .0750007  75.92739          .   5.334289  2.3503118 11.167417  -2.590258  -4.426897   .4372757   7.331371 1.6981722  .1915441
          55 2018    .09581817  72.02344   6.512732   5.334289  2.3503118 10.991241  -1.708301 -3.9881756   .5897358  -4.772674  1.307601  .2294221
          55 2019    .08844751 75.811104          .   5.334289  2.3503118 11.397683  -2.574182 -4.3946176   .7094877  -8.209496  1.304022 .22279187
          55 2020   .030657856  78.49215          .   5.334289  2.3503118  11.92215  -2.966057  -4.426608  .52061236   6.658229 1.2673837 .24075544
          55 2021     .0787694  79.43053   9.707477   5.334289  2.3503118 11.894979  -2.902048  -4.245286   .4429294   5.034722 1.2333057    .39117
          64 2019    .04552026 15.908957          .          .          .  6.581214 -1.7237304  -8.190653 .021798827 .034497246 1.1503124  .4509397
          67 2016    -.4836346  16.96303 -13.794436          . -1.9045488  6.329994  -2.508727   -5.85999          0          0 1.1767914 .20782527
          67 2017    -.7526619 25.688423  -8.847367          . -1.9045488   5.95196  -1.765537 -3.2046885          0          0 1.6981722  .1915441
          67 2018    -.4538895  21.92274          .          . -1.9045488  6.291943  -1.765102  -2.608076          0          0  1.307601  .2294221
          67 2019    -.3003883  44.66124   12.17288          . -1.9045488  6.663366  -1.912919 -3.0179164 .008121984  .01401017  1.304022 .22279187
          67 2020    -.3597984  38.51894          .          . -1.9045488  6.662642  -1.258052  -2.728858  .05680947   .0790212 1.2673837 .24075544
          67 2021    -.2397725 37.023396          .          . -1.9045488  6.551255  -1.440961  -2.818358  .08016602   .1191176 1.2333057    .39117
          77 2017   -.07277151  30.92537          .  1.9133438 -2.4441466  6.007495 -2.0970535  -6.923786  .12682058  3.5366514  1.170393  .7551558
          77 2018  -.063103504  38.66709   5.914056  1.9133438 -2.4441466  5.936816 -1.8893706  -6.853106   .3460989   2.695283 1.1532891  .6842193
          77 2019   -.03749592  31.05715          .  1.9133438 -2.4441466  6.082632 -2.0485153  -6.775779   .3647899   3.205149  1.242983  .6460786
          77 2020   .007795456 36.018578   .6849728  1.9133438 -2.4441466  6.196295 -2.2886019  -7.805733   .4348508   3.483995 1.0269183  .6816548
          77 2021  -.013145233 36.276577          .  1.9133438 -2.4441466   6.17399 -2.2088246  -7.783428  .39043695   2.896674  1.313438   .580654
          90 2006     .1689709  19.29672          .   4.723263  -1.049143  6.714515 -1.2070436  -2.418591          0          0  1.210701  .3403699
          90 2007    .27885205  20.60276    -20.811   4.723263  -1.049143  6.805304  -.8525646  -2.510743          0          0 1.2524844  .3193658
          90 2010    .03118007  23.12704   -9.11326   4.723263  -1.049143  9.503458 -3.0388694 -3.6983225          0          0         .  .3380032
          90 2011    .08172027  18.78308          .   4.723263  -1.049143  9.493789  -3.022989  -3.656058          0          0 1.1470146  .3468503
          90 2012     .0809155 11.309568 -35.164585   4.723263  -1.049143  9.560997  -3.157423  -3.579583          0          0 1.0281603  .4002011
          90 2013   .072081074 32.784096    2.61755   4.723263  -1.049143  9.547669 -3.1777685  -3.553708    .333143   .7086983  1.003063   .381912
          90 2014    .05662553 33.575905  -2.702307   4.723263  -1.049143  9.598727  -3.251338  -3.394169  .29323205   .5978156 1.0709003  .4399855
          90 2015    .05848797  46.18123  13.039525   4.723263  -1.049143  9.632401  -3.161601  -3.372819  .26745787  .50557756 1.0281149  .4325918
          90 2016    .05535182  43.18066  -9.348376   4.723263  -1.049143   9.76721 -2.9023616   -3.30418   .2800252    .535914 1.0903251  .3762313
          90 2017   .014623956 36.320972   3.244347   4.723263  -1.049143  9.834566  -2.860087  -3.272122   .2351618   .4639611 1.1100184  .3464299
          90 2018    .10165405  43.33405  13.431443   4.723263  -1.049143  9.788918  -2.784944  -3.341612   .1497617  .23518535  1.119816  .3838807
          90 2019    .07573696  50.06056    7.95735   4.723263  -1.049143  9.895707  -2.989954 -3.5206826  .14537667  .23022257 1.0995812 .41853705
          90 2020    .09507118   54.3444  19.494137   4.723263  -1.049143 10.047977   -3.00046  -3.433252    .165693  .25902772  1.068727  .4331855
          90 2021    .10771871  61.34533          .   4.723263  -1.049143  10.12887  -2.930685 -3.5276384   .1524585  .22143303  1.127538  .4690302
          92 2014    .08108482 17.136501 -37.909817   4.745368 -1.1800754  7.681607 -4.1177235  -5.093843   .1630921   .3039106         .         1
          92 2015    .09141422  32.43112 -26.737314   4.745368 -1.1800754  7.795482  -4.079474  -5.310575  .14504445  .25911763 1.1308544         1
          end
          label values cusipnr cusipnr
          label def cusipnr 2 "000360206", modify
          label def cusipnr 5 "00081T108", modify
          label def cusipnr 8 "000899104", modify
          label def cusipnr 14 "001084102", modify
          label def cusipnr 23 "00163U106", modify
          label def cusipnr 33 "00183L102", modify
          label def cusipnr 34 "00184X105", modify
          label def cusipnr 36 "00191G103", modify
          label def cusipnr 40 "00206R102", modify
          label def cusipnr 55 "00287Y109", modify
          label def cusipnr 64 "00401C108", modify
          label def cusipnr 67 "004225108", modify
          label def cusipnr 77 "004397105", modify
          label def cusipnr 90 "00507V109", modify
          label def cusipnr 92 "00508Y102", modify


          Code:
           xtreg roa c.csr_score##c.csr_score##c.consistency ln_firmsize ln_adi ln_rdi slack lev_w industry_growth industry_concentrati
          > on i.fyear, fe cluster(cusipnr)
          note: consistency omitted because of collinearity.
          
          Fixed-effects (within) regression               Number of obs     =      4,416
          Group variable: cusipnr                         Number of groups  =        606
          
          R-squared:                                      Obs per group:
               Within  = 0.0749                                         min =          3
               Between = 0.0713                                         avg =        7.3
               Overall = 0.0471                                         max =         16
          
                                                          F(26,605)         =       4.40
          corr(u_i, Xb) = -0.3013                         Prob > F          =     0.0000
          
                                                                 (Std. err. adjusted for 606 clusters in cusipnr)
          -------------------------------------------------------------------------------------------------------
                                                |               Robust
                                            roa | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
          --------------------------------------+----------------------------------------------------------------
                                      csr_score |    .001772   .0005536     3.20   0.001     .0006847    .0028592
                                                |
                        c.csr_score#c.csr_score |  -.0000184   5.17e-06    -3.56   0.000    -.0000286   -8.26e-06
                                                |
                                    consistency |          0  (omitted)
                                                |
                      c.csr_score#c.consistency |  -.0006745   .0002693    -2.50   0.013    -.0012034   -.0001455
                                                |
          c.csr_score#c.csr_score#c.consistency |   7.38e-06   2.61e-06     2.83   0.005     2.26e-06    .0000125
                                                |
                                    ln_firmsize |   -.003396   .0062653    -0.54   0.588    -.0157004    .0089084
                                         ln_adi |  -.0045337    .005554    -0.82   0.415    -.0154412    .0063737
                                         ln_rdi |  -.0487821    .008959    -5.45   0.000    -.0663766   -.0311876
                                          slack |  -.1150484   .0319061    -3.61   0.000    -.1777086   -.0523881
                                          lev_w |   .0001941   .0007528     0.26   0.797    -.0012842    .0016725
                                industry_growth |   .0269596   .0120662     2.23   0.026     .0032629    .0506563
                         industry_concentration |  -.0014657   .0170921    -0.09   0.932    -.0350329    .0321014
                                                |
                                          fyear |
                                          2004  |   .0265101   .0091279     2.90   0.004     .0085839    .0444363
                                          2005  |    .026324   .0113385     2.32   0.021     .0040564    .0485917
                                          2006  |   .0292448   .0124297     2.35   0.019     .0048342    .0536555
                                          2007  |   .0217059   .0125761     1.73   0.085    -.0029923     .046404
                                          2011  |    .026565   .0137926     1.93   0.055    -.0005222    .0536521
                                          2012  |   .0140146   .0139053     1.01   0.314     -.013294    .0413231
                                          2013  |   .0177353   .0141622     1.25   0.211    -.0100778    .0455484
                                          2014  |   .0227091   .0142315     1.60   0.111      -.00524    .0506581
                                          2015  |   .0174202   .0148292     1.17   0.241    -.0117026    .0465431
                                          2016  |   .0199863   .0148575     1.35   0.179    -.0091923    .0491649
                                          2017  |   .0167473    .015588     1.07   0.283     -.013866    .0473605
                                          2018  |   .0343683   .0159241     2.16   0.031     .0030951    .0656415
                                          2019  |   .0268363     .01695     1.58   0.114    -.0064518    .0601243
                                          2020  |   .0244969   .0181309     1.35   0.177    -.0111102    .0601041
                                          2021  |    .046595   .0183382     2.54   0.011     .0105808    .0826092
                                                |
                                          _cons |  -.1899549   .0600566    -3.16   0.002    -.3078996   -.0720102
          --------------------------------------+----------------------------------------------------------------
                                        sigma_u |   .1305783
                                        sigma_e |  .08189417
                                            rho |  .71770186   (fraction of variance due to u_i)
          -------------------------------------------------------------------------------------------------------
          Code:
          sum consistency
          
              Variable |        Obs        Mean    Std. dev.       Min        Max
          -------------+---------------------------------------------------------
           consistency |      4,829   -.1423454    1.858059  -5.954534   5.746652
          
           sum csr_score
          
              Variable |        Obs        Mean    Std. dev.       Min        Max
          -------------+---------------------------------------------------------
             csr_score |      4,850    42.64924     21.8346   .7918259   95.10387

          Comment


          • #6
            OK, it seems that -margins- is getting confused by the (appropriate) omission of consistency (which is time-invariant within cusipnr). And it is not colinear with anything else. By rephrasing the regression command slightly, you avoid this problem:

            Code:
            xtreg roa  c.csr_score##c.csr_score c.csr_score##c.csr_score#c.consistency ln_firmsize ln_adi ln_rdi ///
                slack lev_w industry_growth industry_concentration i.fyear, fe cluster(cusipnr)
            This does not change the model: you are still modeling a quadratic relationship to csr_score moderated by consistency. But by avoiding the explicit omission of the consistency variable, you remove the stumbling block to running -margins-:
            Code:
            . margins, at(csr_score = (20(20)60) consistency = (-2(1)3))
            
            Predictive margins                                          Number of obs = 92
            Model VCE: Robust
            
            Expression: Linear prediction, predict()
            1._at:  csr_score   = 20
                    consistency = -2
            2._at:  csr_score   = 20
                    consistency = -1
            3._at:  csr_score   = 20
                    consistency =  0
            4._at:  csr_score   = 20
                    consistency =  1
            5._at:  csr_score   = 20
                    consistency =  2
            6._at:  csr_score   = 20
                    consistency =  3
            7._at:  csr_score   = 40
                    consistency = -2
            8._at:  csr_score   = 40
                    consistency = -1
            9._at:  csr_score   = 40
                    consistency =  0
            10._at: csr_score   = 40
                    consistency =  1
            11._at: csr_score   = 40
                    consistency =  2
            12._at: csr_score   = 40
                    consistency =  3
            13._at: csr_score   = 60
                    consistency = -2
            14._at: csr_score   = 60
                    consistency = -1
            15._at: csr_score   = 60
                    consistency =  0
            16._at: csr_score   = 60
                    consistency =  1
            17._at: csr_score   = 60
                    consistency =  2
            18._at: csr_score   = 60
                    consistency =  3
            
            ------------------------------------------------------------------------------
                         |            Delta-method
                         |     Margin   std. err.      z    P>|z|     [95% conf. interval]
            -------------+----------------------------------------------------------------
                     _at |
                      1  |  -.0431656    .063464    -0.68   0.496    -.1675529    .0812216
                      2  |  -.0606716   .0525997    -1.15   0.249    -.1637652     .042422
                      3  |  -.0781775   .0494046    -1.58   0.114    -.1750087    .0186536
                      4  |  -.0956835   .0552261    -1.73   0.083    -.2039246    .0125577
                      5  |  -.1131894   .0677795    -1.67   0.095    -.2460348     .019656
                      6  |  -.1306954   .0841025    -1.55   0.120    -.2955333    .0341426
                      7  |   .0710921    .090131     0.79   0.430    -.1055615    .2477456
                      8  |    .049018   .0569692     0.86   0.390    -.0626397    .1606757
                      9  |   .0269439    .025928     1.04   0.299    -.0238739    .0777618
                     10  |   .0048699   .0200972     0.24   0.809    -.0345198    .0442596
                     11  |  -.0172042   .0494004    -0.35   0.728    -.1140272    .0796189
                     12  |  -.0392782   .0823516    -0.48   0.633    -.2006844    .1221279
                     13  |   .0732546   .1101161     0.67   0.506    -.1425689    .2890782
                     14  |   .0595503    .074591     0.80   0.425    -.0866454    .2057459
                     15  |   .0458459   .0456096     1.01   0.315    -.0435472    .1352391
                     16  |   .0321416   .0409246     0.79   0.432    -.0480691    .1123523
                     17  |   .0184373   .0659361     0.28   0.780    -.1107951    .1476696
                     18  |   .0047329   .1004911     0.05   0.962    -.1922261    .2016919
            ------------------------------------------------------------------------------
            I don't know why this happens in this circumstance but not more generally.

            Comment


            • #7
              thanks a lot, Clyde! It worked very good with this little adjustment

              Comment

              Working...
              X