Announcement

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

  • interpretation of interaction terms in panel data models

    Dear All,

    I have a problem with the interpretation of interaction terms in my regression. My regression formula is as follows:

    PRICEit = α0 + α1IFRSit + α2SMARKETin + α3BVPSit + α4SMARKETint*BVPSit + α5IFRSit*BVPSit + α6SMARKETint*IFRSit*BVPSit + α7EPSit + α8SMARKETint*EPSit + α9IFRSit*EPSit + α10SMARKETint*IFRSit*EPSit + α11SIZEit + α12LEVit + αa∑YEARi + εit

    IFRS is a dummy variable which is 1 for the years 2005 and after, 0 otherwise
    SMARKET is a proxy variable for the strength of capital market in the country. It takes 1 for the country-year observations if the country’s score is greater than or equal to the sample median for that year.

    My aim is to see the incremental effect of SMARKET for the value relevance of BVPS and EPS in the before and after IFRS periods. To see this I put interaction terms as SMARKETint*BVPSit and SMARKETint*IFRSit*BVPSit for BVPS and SMARKETint*EPSit and SMARKETint*IFRSit*EPSit for EPS.

    I put the regression results in the attached file. First I run the regression model for the whole period, then to check if the results are logical or not, I run the regression model seperately for the afterIFRS and beforeIFRS periods. In the whole period results, sign of the SMARKET_BVPS is positive which means SMARKET have a positive incremental effect on BVPS in beforeIFRS period. However, in the beforeIFRS regression results, the sign of SMARKET_BVPS is negative which contradicts with the whole period results. There are some other inconsistencies like this but I think if I can understand the reason of one, others will also be clear for me.

    I would aprreciate if you tell me what is wrong with my model or my interpretations regarding regression results.

    Thanks in advance
    Attached Files

  • #2
    I think you are more likely to get a helpful response if you repost your question with the following changes:

    1. Do not attach Microsoft Office files. Not everyone here uses Office products, and even those who do may be reluctant to download them from strangers, as they can contain active malware.

    2. Show your actual Stata code, not an equation for a model. Your code may or may not actually correspond to the model you intend. Show the exact code without any edits; copy it directly from your do-file or log-file and paste it into the Forum editor window between code delimieters.

    3. Show your actual Stata output, copied from Stata's Results window or your log file and pasted into the Forum editor window between code delimiters. (If you are not familiar with code delimiters, read FAQ #12.) Important: the output you show should be the direct output of the Stata estimation command, not how it appears after being laundered through -estout-, -esttab- or any other pretty-print program.

    Comment


    • #3
      Dear Mr.Schechter,

      Thank you for your warnings. I hope I could post in the right way now.

      In the codes below;

      IFRS is a dummy variable which is 1 for the years 2005 and after, 0 otherwise
      SMARKET is a proxy variable for the strength of capital market in the country. It takes 1 for the country-year observations if the country’s score is greater than or equal to the sample median for that year.

      My aim is to see the incremental effect of SMARKET for the value relevance of BVPS and EPS in the before and after IFRS periods. To see this I put interaction terms as SMARKET_wBVPS and SMARKET_IFRS_wBVPS for BVPS and SMARKET*wEPS and SMARKET*IFRS*wEPS for EPS.

      I put the regression results below. First I run the regression model for the whole period, then to check if the results are logical or not, I run the regression model seperately for the afterIFRS and beforeIFRS periods. In the whole period results, sign of the SMARKET_wBVPS is positive which means SMARKET has a positive incremental effect on BVPS in beforeIFRS period. However, in the beforeIFRS regression results, the sign of SMARKET_BVPS is negative which contradicts with the whole period results. There are some other inconsistencies like this but I think if I can understand the reason of one, others will also be clear for me.

      I would appreciate if you tell me what is wrong with my models or my interpretations regarding regression results.

      Thanks in advance


      Regression for the whole period

      Code:
      xtscc wPJUN IFRS SMARKETDUMMY wBVPS SMARKET_wBVPS IFRS_wBVPS SMARKET_IFRS_wBVPS wEPS SMARKET_wEPS IFRS_wEPS SMARKET_IFRS_wEPS wSIZE wLEV YEAR2 YEAR3 YEAR4 YEAR5 YEAR6 YEAR7 YEAR8 YEAR9 YEAR10 YEAR11 YEAR12 YEAR13 YEAR14 , fe
      Code:
      Regression with Driscoll-Kraay standard errors   Number of obs     =      5066
      Method: Fixed-effects regression                 Number of groups  =       536
      Group variable (i): ID                           F( 25,    14)     =  31767.16
      maximum lag: 2                                   Prob > F          =    0.0000
                                                       within R-squared  =    0.3448
      
      ------------------------------------------------------------------------------------
                         |             Drisc/Kraay
                   wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------------+----------------------------------------------------------------
                    IFRS |   2.535502   1.478285     1.72   0.108     -.635105    5.706109
            SMARKETDUMMY |  -.0038235    1.47873    -0.00   0.998    -3.175384    3.167737
                   wBVPS |   .1032945   .1505299     0.69   0.504    -.2195601     .426149
           SMARKET_wBVPS |   .2652108   .1149516     2.31   0.037     .0186641    .5117574
              IFRS_wBVPS |   .2293586   .1422089     1.61   0.129    -.0756493    .5343664
      SMARKET_IFRS_wBVPS |  -.2524474    .146141    -1.73   0.106    -.5658888    .0609939
                    wEPS |  -.0243157   .5456786    -0.04   0.965     -1.19468    1.146049
            SMARKET_wEPS |  -.1613746   .6302317    -0.26   0.802    -1.513087    1.190338
               IFRS_wEPS |   2.544014   .7279175     3.49   0.004     .9827862    4.105242
       SMARKET_IFRS_wEPS |  -.6961183   1.079498    -0.64   0.529    -3.011412    1.619176
                   wSIZE |   8.888573   .6624971    13.42   0.000     7.467658    10.30949
                    wLEV |  -3.162454   2.077056    -1.52   0.150    -7.617296    1.292388
                   YEAR2 |    1.71358   .1644419    10.42   0.000     1.360887    2.066273
                   YEAR3 |   3.789939   .6343417     5.97   0.000     2.429411    5.150466
                   YEAR4 |   5.570656   .2190016    25.44   0.000     5.100944    6.040367
                   YEAR5 |   6.884495   .1912971    35.99   0.000     6.474204    7.294787
                   YEAR6 |   .3134389   .7196931     0.44   0.670    -1.230149    1.857027
                   YEAR7 |   6.683483   .5593522    11.95   0.000     5.483792    7.883174
                   YEAR8 |  -1.426617   .5632732    -2.53   0.024    -2.634718   -.2185164
                   YEAR9 |  -2.667577   .2333803   -11.43   0.000    -3.168128   -2.167026
                  YEAR10 |  -1.948411    .280527    -6.95   0.000    -2.550082   -1.346741
                  YEAR11 |  -2.582609    .704198    -3.67   0.003    -4.092964   -1.072255
                  YEAR12 |  -3.243805   .7672285    -4.23   0.001    -4.889347   -1.598264
                  YEAR13 |  -1.892911   .7039893    -2.69   0.018    -3.402818   -.3830039
                  YEAR14 |  -.4319344   .6675405    -0.65   0.528    -1.863666    .9997975
                   _cons |   -79.1026   5.812335   -13.61   0.000    -91.56882   -66.63638
      ------------------------------------------------------------------------------------
      
      
      .
      Regression for the period beforeIFRS

      Code:
      xtscc wPJUN SMARKETDUMMY wBVPS SMARKET_wBVPS wEPS SMARKET_wEPS wSIZE wLEV YEAR1 YEAR2 YEAR3 YEAR4 YEAR5 if YEAR<2005, fe
      Code:
      Regression with Driscoll-Kraay standard errors   Number of obs     =      1221
      Method: Fixed-effects regression                 Number of groups  =       286
      Group variable (i): ID                           F( 11,     4)     =    342.53
      maximum lag: 2                                   Prob > F          =    0.0000
                                                       within R-squared  =    0.2387
      
      -------------------------------------------------------------------------------
                    |             Drisc/Kraay
              wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
       SMARKETDUMMY |  -.4093558    .492581    -0.83   0.453     -1.77698    .9582683
              wBVPS |   .4919831    .115887     4.25   0.013     .1702292    .8137369
      SMARKET_wBVPS |  -.0719885   .0215891    -3.33   0.029    -.1319296   -.0120474
               wEPS |   .4465511   .6768183     0.66   0.545    -1.432598      2.3257
       SMARKET_wEPS |   .3537413   .9329061     0.38   0.724    -2.236421    2.943904
              wSIZE |   8.641765    1.18387     7.30   0.002     5.354815    11.92872
               wLEV |   13.05309   1.493408     8.74   0.001      8.90672    17.19945
              YEAR1 |  -6.690068    .134843   -49.61   0.000    -7.064452   -6.315684
              YEAR2 |  -5.074944   .2196414   -23.11   0.000    -5.684766   -4.465122
              YEAR3 |  -4.453034   .4767792    -9.34   0.001    -5.776785   -3.129283
              YEAR4 |  -1.101597   .2404087    -4.58   0.010    -1.769078   -.4341152
              YEAR5 |          0  (omitted)
              _cons |  -77.41133   10.03579    -7.71   0.002    -105.2752   -49.54751
      -------------------------------------------------------------------------------
      Regression for the period afterIFRS

      Code:
      xtscc wPJUN SMARKETDUMMY wBVPS SMARKET_wBVPS wEPS SMARKET_wEPS wSIZE wLEV YEAR7 YEAR8 YEAR9 YEAR10 YEAR11 YEAR12 YEAR13 YEAR14 YEAR15 if YEAR>2004, fe
      Code:
      Regression with Driscoll-Kraay standard errors   Number of obs     =      3845
      Method: Fixed-effects regression                 Number of groups  =       510
      Group variable (i): ID                           F( 16,     9)     =  33469.95
      maximum lag: 2                                   Prob > F          =    0.0000
                                                       within R-squared  =    0.2826
      
      -------------------------------------------------------------------------------
                    |             Drisc/Kraay
              wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
       SMARKETDUMMY |     1.6605   1.546499     1.07   0.311    -1.837923    5.158923
              wBVPS |   .2186164   .0965038     2.27   0.050     .0003096    .4369232
      SMARKET_wBVPS |   .0676715   .0784386     0.86   0.411    -.1097691     .245112
               wEPS |    2.76315   .6319427     4.37   0.002     1.333597    4.192704
       SMARKET_wEPS |  -1.505607   .6264092    -2.40   0.040    -2.922643    -.088571
              wSIZE |   9.183238   .8533565    10.76   0.000     7.252812    11.11367
               wLEV |   .0104509   3.215236     0.00   0.997    -7.262918     7.28382
              YEAR7 |   6.580856   .6260517    10.51   0.000     5.164629    7.997084
              YEAR8 |  -1.333926   .7333955    -1.82   0.102    -2.992982    .3251298
              YEAR9 |   -2.53248   .8157098    -3.10   0.013    -4.377744   -.6872163
             YEAR10 |  -1.872758   .6902359    -2.71   0.024     -3.43418   -.3113363
             YEAR11 |  -2.883621   .9761346    -2.95   0.016    -5.091791   -.6754515
             YEAR12 |  -3.667251   1.046344    -3.50   0.007    -6.034245   -1.300257
             YEAR13 |  -2.161751   1.065502    -2.03   0.073    -4.572085    .2485827
             YEAR14 |  -.7411639   .9419196    -0.79   0.452    -2.871934    1.389606
             YEAR15 |   .4042819   .6020939     0.67   0.519     -.957749    1.766313
              _cons |  -82.17731   7.726025   -10.64   0.000    -99.65479   -64.69983
      -------------------------------------------------------------------------------

      Comment


      • #4
        OK. These models are mis-specified, so their results are meaningless and uninterpretable.

        Whenever you have an interaction term, you must include all of the constituent effects, and all lower-order included interactions. So, looking at, for example, SMARKET_IFRS_wBVPS, you did not include SMARKET_IFRS. It is all to easy to make this kind of mistake, as with three-way interactions it gets complicated keeping track.

        So rather than calculating your own interaction terms, which, as you see, is quite error prone, you should use Stata's factor variable notation to do that, assuming that -xtscc- supports it. (-xtscc- is not part of official Stata, and I know very little about it; in particlar I don't know if you can use factor variable notation with it. See -help fvvarlist-. I can't tell from your description whether wEPS and wBVPS are also categorical variables, or if they are continuous. For purposes of illustration here, I will assume they are continuous. So you would code this as

        Code:
        xtscc wPJUN i. IFRS##SMARKETDUMMY##c.(wEOS wBVPS) wSIZE wLEV i.YEAR, fe
        Stata will automatically supply all the necessary "main" effects and lower-order interaction terms for you. Notice also that the code is much more compact and readable.

        If -xtscc- does not work with factor variable notation, then you will have to do it as you did before, but you must include all of the lower-order interactions for your model to be valid.

        An added advantage of using factor variable notation is that you will be able to use the -margins- and -marginsplot- commands after estimation to make interpretation of your results much easier. Even two-way interactions are hard for many people to grasp, and rare indeed is the person who can look at the output of a three-way interaction model (let alone one with two three-way interactions) and have even a clue what it means. If you are not familiar with the -margins- command, the best introduction around is the excellent Richard Williams' https://www3.nd.edu/~rwilliam/stats/Margins01.pdf. It has several worked examples and is clearly written. It does not include any examples with three way interactions, but the principles are the same, it's just a tad more complicated.


        Last edited by Clyde Schechter; 24 Jul 2018, 14:29.

        Comment


        • #5
          Dear Mr.Schechter,

          Thank you very much for your help. Because -xtscc- does not work with factor variable notation I created SMARKET_IFRS interaction and put in my regression model and run it for the wholeperiod, beforeIFRS period and afterIFRS period again. Unfortunately same inconsistencies are valid again: e.g.In the whole period results, sign of the SMARKET_wBVPS is positive which means SMARKET has a positive incremental effect on BVPS when IFRS is 0 which means in beforeIFRS period. However, in the beforeIFRS regression results, the sign of SMARKET_BVPS is negative which contradicts with the whole period results. I cannot use -margins- command because I could not use factor variable notation. So, I have difficulty to interpret the results of these 3 periods. Could you please help me on this subject?

          Regression for the whole period

          Code:
          xtscc wPJUN IFRS SMARKETDUMMY SMARKET_IFRS wEPS wBVPS IFRS_wEPS IFRS_wBVPS SMARKET_wEPS SMARKET_wBVPS SMARKET_IFRS_wEPS SMARKET_IFRS_wBVPS wSIZE wLEV YEAR2 YEAR3 YEAR4 YEAR5 YEAR6 YEAR7 YEAR8 YEAR9 YEAR10 YEAR11 YEAR12 YEAR13 YEAR14 , fe
          Code:
          Regression with Driscoll-Kraay standard errors   Number of obs     =      5066
          Method: Fixed-effects regression                 Number of groups  =       536
          Group variable (i): ID                           F( 26,    14)     =  22766.02
          maximum lag: 2                                   Prob > F          =    0.0000
                                                           within R-squared  =    0.3474
          
          ------------------------------------------------------------------------------------
                             |             Drisc/Kraay
                       wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------------+----------------------------------------------------------------
                        IFRS |  -1.482694   1.579271    -0.94   0.364    -4.869894    1.904506
                SMARKETDUMMY |  -4.563633    1.81356    -2.52   0.025    -8.453332   -.6739334
                SMARKET_IFRS |   6.110294   1.330162     4.59   0.000      3.25738    8.963208
                        wEPS |  -.0047196   .5397996    -0.01   0.993    -1.162474    1.153035
                       wBVPS |   .0733339   .1574815     0.47   0.649    -.2644303    .4110981
                   IFRS_wEPS |   2.533283   .7255408     3.49   0.004     .9771524    4.089413
                  IFRS_wBVPS |   .2583075   .1484747     1.74   0.104    -.0601391    .5767541
                SMARKET_wEPS |  -.1818916   .6632389    -0.27   0.788    -1.604398    1.240614
               SMARKET_wBVPS |   .3049495   .1235313     2.47   0.027     .0400012    .5698979
           SMARKET_IFRS_wEPS |  -.7298173   1.110956    -0.66   0.522     -3.11258    1.652946
          SMARKET_IFRS_wBVPS |  -.2954609   .1545127    -1.91   0.077    -.6268577    .0359359
                       wSIZE |   9.115189    .630144    14.47   0.000     7.763665    10.46671
                        wLEV |  -3.138363   2.052789    -1.53   0.149    -7.541158    1.264432
                       YEAR2 |   1.725937   .1617055    10.67   0.000     1.379113    2.072761
                       YEAR3 |   3.100753   .3999875     7.75   0.000     2.242865     3.95864
                       YEAR4 |   5.546959   .2239024    24.77   0.000     5.066736    6.027182
                       YEAR5 |   6.745554   .1721857    39.18   0.000     6.376253    7.114856
                       YEAR6 |   .1603403   .7473375     0.21   0.833    -1.442539     1.76322
                       YEAR7 |   6.619201   .5619971    11.78   0.000     5.413837    7.824565
                       YEAR8 |  -1.535577   .5556454    -2.76   0.015    -2.727318   -.3438366
                       YEAR9 |  -2.632774   .2251212   -11.69   0.000    -3.115611   -2.149937
                      YEAR10 |  -1.956864   .2814997    -6.95   0.000    -2.560621   -1.353107
                      YEAR11 |  -3.129813   .5757109    -5.44   0.000     -4.36459   -1.895036
                      YEAR12 |  -3.736377    .596151    -6.27   0.000    -5.014993    -2.45776
                      YEAR13 |  -2.464711   .5718405    -4.31   0.001    -3.691187   -1.238235
                      YEAR14 |  -1.050749    .517512    -2.03   0.062    -2.160702    .0592036
                       _cons |  -78.25628    4.99068   -15.68   0.000    -88.96023   -67.55234
          ------------------------------------------------------------------------------------
          Regression for the period beforeIFRS

          Code:
          xtscc wPJUN SMARKETDUMMY wEPS wBVPS SMARKET_wEPS SMARKET_wBVPS wSIZE wLEV YEAR1 YEAR2 YEAR3 YEAR4 YEAR5 if YEAR<2005, fe
          Code:
          Regression with Driscoll-Kraay standard errors   Number of obs     =      1221
          Method: Fixed-effects regression                 Number of groups  =       286
          Group variable (i): ID                           F( 11,     4)     =    342.53
          maximum lag: 2                                   Prob > F          =    0.0000
                                                           within R-squared  =    0.2387
          
          -------------------------------------------------------------------------------
                        |             Drisc/Kraay
                  wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          --------------+----------------------------------------------------------------
           SMARKETDUMMY |  -.4093558    .492581    -0.83   0.453     -1.77698    .9582683
                   wEPS |   .4465511   .6768183     0.66   0.545    -1.432598      2.3257
                  wBVPS |   .4919831    .115887     4.25   0.013     .1702292    .8137369
           SMARKET_wEPS |   .3537413   .9329061     0.38   0.724    -2.236421    2.943904
          SMARKET_wBVPS |  -.0719885   .0215891    -3.33   0.029    -.1319296   -.0120474
                  wSIZE |   8.641765    1.18387     7.30   0.002     5.354815    11.92872
                   wLEV |   13.05309   1.493408     8.74   0.001      8.90672    17.19945
                  YEAR1 |  -6.690068    .134843   -49.61   0.000    -7.064452   -6.315684
                  YEAR2 |  -5.074944   .2196414   -23.11   0.000    -5.684766   -4.465122
                  YEAR3 |  -4.453034   .4767792    -9.34   0.001    -5.776785   -3.129283
                  YEAR4 |  -1.101597   .2404087    -4.58   0.010    -1.769078   -.4341152
                  YEAR5 |          0  (omitted)
                  _cons |  -77.41133   10.03579    -7.71   0.002    -105.2752   -49.54751
          -------------------------------------------------------------------------------
          
          
          .
          Regression for the period afterIFRS

          Code:
          xtscc wPJUN SMARKETDUMMY wEPS wBVPS SMARKET_wEPS SMARKET_wBVPS wSIZE wLEV YEAR6 YEAR7 YEAR8 YEAR9 YEAR10 YEAR11 YEAR12 YEAR13 YEAR14 if YEAR>2004, fe
          Code:
          Regression with Driscoll-Kraay standard errors   Number of obs     =      3845
          Method: Fixed-effects regression                 Number of groups  =       510
          Group variable (i): ID                           F( 16,     9)     =  33469.95
          maximum lag: 2                                   Prob > F          =    0.0000
                                                           within R-squared  =    0.2826
          
          -------------------------------------------------------------------------------
                        |             Drisc/Kraay
                  wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          --------------+----------------------------------------------------------------
           SMARKETDUMMY |     1.6605   1.546499     1.07   0.311    -1.837923    5.158923
                   wEPS |    2.76315   .6319427     4.37   0.002     1.333597    4.192704
                  wBVPS |   .2186164   .0965038     2.27   0.050     .0003096    .4369232
           SMARKET_wEPS |  -1.505607   .6264092    -2.40   0.040    -2.922643    -.088571
          SMARKET_wBVPS |   .0676715   .0784386     0.86   0.411    -.1097691     .245112
                  wSIZE |   9.183238   .8533565    10.76   0.000     7.252812    11.11367
                   wLEV |   .0104509   3.215236     0.00   0.997    -7.262918     7.28382
                  YEAR6 |  -.4042819   .6020939    -0.67   0.519    -1.766313     .957749
                  YEAR7 |   6.176575   .6052624    10.20   0.000     4.807376    7.545773
                  YEAR8 |  -1.738208   .6238713    -2.79   0.021    -3.149503    -.326913
                  YEAR9 |  -2.936762    .252113   -11.65   0.000    -3.507081   -2.366443
                 YEAR10 |   -2.27704   .2814338    -8.09   0.000    -2.913688   -1.640393
                 YEAR11 |  -3.287903   .6525281    -5.04   0.001    -4.764024   -1.811782
                 YEAR12 |  -4.071533   .6160845    -6.61   0.000    -5.465213   -2.677853
                 YEAR13 |  -2.566033   .6683532    -3.84   0.004    -4.077953   -1.054113
                 YEAR14 |  -1.145446   .6004506    -1.91   0.089    -2.503759    .2128677
                  _cons |  -81.77303   7.405114   -11.04   0.000    -98.52456    -65.0215
          -------------------------------------------------------------------------------
          
          
          .

          Comment


          • #6
            There is nothing contradictory in these results. In the whole period model you have additional terms involving IFRS (and even interactions with it) that are not present in the before and after models. So there is no reason to expect the results for anything in the before and after models to look like the results in the full-period model. There is nothing to explain here.

            Let me make a suggestion. For the moment, put aside the Driscoll-Kraay standard errors. Run the models with -xtreg, fe- using factor-variable notation and then use the -margins- commands to calculate actual marginal effects at specific values. Then you'll be able to see what's really going on. Also the factor variable code is simpler; it has fewer terms and you will be able to immediately see when you are working with comparable models and when you aren't. Once you have a feel for how it's all working out, then go back and redo them using -xtscc- for your final results. A model with two 3-way interactions is very difficult to interpret, and you have a substantial exercise in algebra facing you when you can't use -margins- in order to get it all straightened out for you.

            Comment


            • #7
              Dear Mr.Schechter,

              Thank you again for your answer. I have already tried to use -margins- commands with -xtreg, fe- model. However, I could not get a clarifying result. I put some -margins- commands and the results of these commands below.

              I am sorry, I know I asked a lot and took your time. This is the last point I need your comment: Actually my aim is to see if the coefficient of wBVPS (and wEPS) increases when SMARKETDUMMY=1 and IFRS=1 compared to the situation when SMARKETDUMMY=1 and IFRS=0. I use the whole period regression results and look at the signs and significancies of the terms SMARKET_IFRS_wBVPS and SMARKET_wBVPS. Because the coefficient of SMARKET_wBVPS is positive and significant, I conclude that when IFRS=0 and SMARKET=1, the relationship between wBVPS and wPJUN (dependent variable) increases significantly. On the other hand, because the coefficient of SMARKET_IFRS_wBVPS is negative but not significant, I conclude that when IFRS=1 and SMARKET =1, the relationship between wBVPS and wPJUN (dependent variable) decreases insignificantly. Is this interpretation is meaningful or not?

              Code:
              xtreg wPJUN i.IFRS##i.SMARKETDUMMY##c.(wEPS wBVPS) wSIZE wLEV i.YEAR, fe
              Code:
              margins, dydx(SMARKETDUMMY IFRS wBVPS) atmeans
              Code:
              Conditional marginal effects                    Number of obs     =      5,066
              Model VCE    : Conventional
              
              Expression   : Linear prediction, predict()
              dy/dx w.r.t. : 1.IFRS 1.SMARKETDUMMY wBVPS
              at           : 0.IFRS          =    .2410186 (mean)
                             1.IFRS          =    .7589814 (mean)
                             0.SMARKETD~Y    =    .3176076 (mean)
                             1.SMARKETD~Y    =    .6823924 (mean)
                             wEPS            =    1.355514 (mean)
                             wBVPS           =    22.55696 (mean)
                             wSIZE           =    10.82329 (mean)
                             wLEV            =    .5327045 (mean)
                             2000.YEAR       =    .0459929 (mean)
                             2001.YEAR       =    .0471773 (mean)
                             2002.YEAR       =    .0483616 (mean)
                             2003.YEAR       =     .049546 (mean)
                             2004.YEAR       =    .0499408 (mean)
                             2005.YEAR       =    .0564548 (mean)
                             2006.YEAR       =    .0631662 (mean)
                             2007.YEAR       =    .0688906 (mean)
                             2008.YEAR       =    .0750099 (mean)
                             2009.YEAR       =    .0763916 (mean)
                             2010.YEAR       =    .0801421 (mean)
                             2011.YEAR       =    .0842874 (mean)
                             2012.YEAR       =    .0838926 (mean)
                             2013.YEAR       =    .0866561 (mean)
                             2014.YEAR       =      .08409 (mean)
              
              --------------------------------------------------------------------------------
                             |            Delta-method
                             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
                      1.IFRS |          .  (not estimable)
              1.SMARKETDUMMY |   .8969183   1.054598     0.85   0.395    -1.170056    2.963893
                       wBVPS |   .3244537   .0219584    14.78   0.000      .281416    .3674913
              --------------------------------------------------------------------------------
              Note: dy/dx for factor levels is the discrete change from the base level.
              Code:
              margins, dydx(wBVPS) at(SMARKETDUMMY==1 IFRS==1)
              Code:
              Average marginal effects                        Number of obs     =      5,066
              Model VCE    : Conventional
              
              Expression   : Linear prediction, predict()
              dy/dx w.r.t. : wBVPS
              at           : IFRS            =           1
                             SMARKETDUMMY    =           1
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                     wBVPS |          .  (not estimable)
              ------------------------------------------------------------------------------
              Code:
              margins SMARKETDUMMY#IFRS, vsquish
              Code:
              Predictive margins                              Number of obs     =      5,066
              Model VCE    : Conventional
              
              Expression   : Linear prediction, predict()
              
              -----------------------------------------------------------------------------------
                                |            Delta-method
                                |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ------------------+----------------------------------------------------------------
              SMARKETDUMMY#IFRS |
                           0 0  |          .  (not estimable)
                           0 1  |          .  (not estimable)
                           1 0  |          .  (not estimable)
                           1 1  |          .  (not estimable)
              -----------------------------------------------------------------------------------

              Comment


              • #8
                Sorry about the -margins- problem. I always forget, but when running -margins- after these -xtreg- models, you have to specify the -noestimcheck- option. Then you will get results.

                Actually my aim is to see if the coefficient of wBVPS (and wEPS) increases when SMARKETDUMMY=1 and IFRS=1 compared to the situation when SMARKETDUMMY=1 and IFRS=0. I use the whole period regression results and look at the signs and significancies of the terms SMARKET_IFRS_wBVPS and SMARKET_wBVPS. Because the coefficient of SMARKET_wBVPS is positive and significant, I conclude that when IFRS=0 and SMARKET=1, the relationship between wBVPS and wPJUN (dependent variable) increases significantly.
                That's wrong. At the most abstract level, the question isn't even defined, because, with so many interactions, the difference you are trying to estimate with respect to BVPS also depends on the value of EPS (and vice versa), but you do not state what value of EPS you have in mind. Let's simplify matters and just stipulate that you want this difference evaluated for the case EPS = 0 so that we can just ignore EPS in the calculations. In that case, the difference you want is not given by the terms you are looking at. The difference is given by the sum of the following coefficients:
                Code:
                IFRS + SMARKETDUMMY#IFRS + SMARKETDUMMY#IFRS#wBVPS + IFRS#wBVPS
                (I told you you're going to have to do a lot of arithmetic to work all this out!) No subset of those terms is sufficient. So you have to get that total. If you want this for some value of EPS other than zero, then you need even more terms (all the terms that include both IFRS and EPS in them, and these have to be multiplied by the stipulated value of EPS.)

                -margins- will give it to you after -xtreg-. But after -xtscc- you will have to get it with -lincom- if you want to do a significance test on it.


                Comment


                • #9
                  Dear Mr.Schechter,

                  I prepared a table as below and run the -lincom- to see if the coefficients are significantly different from each other. As an example I put only the test of difference between IFRS=1, SMARKET=1 and IFRS=0, SMARKET=1. Could you please check if I did in the right way?

                  I also tried to understand how I can do the same thing with -margins- using mean value of EPS but I could not find the right code.


                  POST-IFRS PRE-IFRS
                  VARIABLE STRONG MARKET WEAK MARKET STRONG MARKET WEAK MARKET
                  BVPS wBVPS + IFRS + IFRS_wBVPS + SMARKETDUMMY + SMARKET_wBVPS + SMARKET_IFRS + SMARKET_IFRS_wBVPS wBVPS + IFRS + IFRS_wBVPS wBVPS + SMARKETDUMMY + SMARKET_wBVPS wBVPS
                  EPS wEPS + IFRS + IFRS_wEPS + SMARKETDUMMY + SMARKET_wEPS + SMARKET_IFRS + SMARKET_IFRS_wEPS wEPS + IFRS + IFRS_wEPS wEPS + SMARKETDUMMY + SMARKET_wEPS wEPS

                  POST-IFRS PRE-IFRS Dif. between post and pre-IFRS
                  VARIABLE STRONG MARKET WEAK MARKET STRONG MARKET WEAK MARKET STRONG MARKET WEAK MARKET
                  BVPS 0.404 -1.152 -4.186 0.073 4.590** -1.225
                  Dif.between strong and weak market 1.556 -4.259**
                  EPS 1.679 1.045 -4.751 0.005 6.425*** 1.05
                  Dif.between strong and weak market 0.634 -4.746**
                  Code:
                  lincom (wBVPS + IFRS + IFRS_wBVPS + SMARKETDUMMY + SMARKET_wBVPS + SMARKET_IFRS + SMARKET_IFRS_wBVPS)- (wBVPS + SMARKETDUMMY + SMARKE
                  > T_wBVPS)
                  Code:
                   ( 1)  IFRS + SMARKET_IFRS + IFRS_wBVPS + SMARKET_IFRS_wBVPS = 0
                  
                  ------------------------------------------------------------------------------
                         wPJUN |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                           (1) |   4.590447   1.653919     2.78   0.015     1.043143     8.13775
                  ------------------------------------------------------------------------------

                  Comment


                  • #10
                    Your -lincom- command looks correct.

                    To get this in -margins- you would do this:

                    [/code]
                    margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean(EPS)), noestimcheck pwcompare(effects)
                    [/code]
                    This will give you the marginal effects of wBVPS at IRRS = 0 and 1 separately, at EPS constrained to its mean, with confidence intervals, along with a test of their equality.

                    Comment


                    • #11
                      Dear Mr.Schechter,

                      When I copy the command in your mail, it first said ") required" then I put the missing ")" and run the command again. This time it says invalid 'noestimcheck' . I put the commands below.


                      Code:
                      xtreg wPJUN i.IFRS##SMARKETDUMMY##c.(wEPS wBVPS) wSIZE wLEV i.YEAR, fe
                      Code:
                      margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean(EPS)), noestimcheck pwcompare(effects)
                      Code:
                      ) required
                      r(100);
                      Code:
                      margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean(EPS))), noestimcheck pwcompare(effects)
                      Code:
                      invalid 'noestimcheck'
                      r(198);
                      In the mean time, I think we have made a mistake while we determine the difference between the coefficients of wBVPS when IFRS=1 + SMARKET=1 and when IFRS=0 + SMARKET=1. We specified the difference as:

                      Code:
                       IFRS + SMARKETDUMMY#IFRS + SMARKETDUMMY#IFRS#wBVPS + IFRS#wBVPS
                      However IFRS and SMARKETDUMMY#IFRS is the intercept difference for wBVPS between two situations, am I wrong? I think the main interest should be on the slope differences for wBVPS between two situations and it should be SMARKETDUMMY#IFRS#wBVPS + IFRS#wBVPS. Is my logic wrong?

                      Comment


                      • #12
                        Code:
                        margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean(EPS))), noestimcheck pwcompare(effects)
                        The comma in red shouldn't be there. Stata syntax has a single comma separating the options from the earlier part of the command, but does not allow commas between options. (In fact, in recent versions of Stata, the extra comma is interpreted as "no more option, I want to go back to the before-the-options part of the command and resume it here." ) I see I made that mistake in #10 of this thread. Sorry about that. This is one reason why you should always post example data when asking for help with code. Had I had example data, I would have tested my code and found and fixed this error before posting.

                        In the mean time, I think we have made a mistake while we determine the difference between the coefficients of wBVPS when IFRS=1 + SMARKET=1 and when IFRS=0 + SMARKET=1. We specified the difference as:

                        Code:
                        IFRS + SMARKETDUMMY#IFRS + SMARKETDUMMY#IFRS#wBVPS + IFRS#wBVPS
                        However IFRS and SMARKETDUMMY#IFRS is the intercept difference for wBVPS between two situations, am I wrong? I think the main interest should be on the slope differences for wBVPS between two situations and it should be SMARKETDUMMY#IFRS#wBVPS + IFRS#wBVPS. Is my logic wrong?
                        You are correct. Again we'll ignore the other interaction with EPS; here is the algebra.

                        When SMARKET = 1 and IFRS = 1, the coefficient of wBVPS in a model with i.SMARKETDUMMY##i.IFRS##c.wBVPS

                        wBVPS + IFRS*wBVPS + SMARKETDUMMY*wBVPS + SMARKETDUMMY*IFRS*wBVPS.

                        When SMARKET = 1 and IFRS = 0, then the coefficient of wBVPS is

                        wBVPS + 0 + SMARKETDUMMY*wBVPS + 0.

                        So the difference is:
                        IFRS*wBVPS + SMARKETDUMMY*IFRS*wBVPS.

                        Sorry for my earlier errors.

                        In the future, when showing data examples, please use the -dataex- command to do so. If you are running version 15.1 or a fully updated version 14.2, it 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.



                        When asking for help with code, always show example data. When showing example data, always use -dataex-.

                        Comment


                        • #13
                          Dear Mr.Schechter,

                          Thank you very much for your patience. I have realized my mistakes in my posts. I will be more careful about my posts from now on.

                          As you told I use -dataex- command to show an example from my data. I am sending it because I could not get a result from -margins-command after removing the comma.

                          Code:
                          * Example generated by -dataex-. To install: ssc install dataex
                          clear
                          input double(wPJUN wBVPS wEPS) byte(IFRS SMARKETDUMMY) double(wSIZE wLEV) int YEAR
                                          50  55.09600067138672   .9449999928474426 0 0 10.130902290344238  .5058481097221375 2000
                                          51 59.025001525878906    4.86299991607666 0 0 10.086475372314453  .4872799217700958 2001
                                        64.5 57.047000885009766 -1.0160000324249268 0 0 10.086475372314453 .46683576703071594 2002
                                          62 57.000999450683594  1.9490000009536743 0 0 10.253510475158691  .3688541054725647 2003
                           66.98999786376953 57.933998107910156  1.8769999742507935 0 0 10.379815101623535 .35178637504577637 2004
                                          90 60.393001556396484   4.590000152587891 1 0 10.506956100463867  .3116730749607086 2005
                                         105  63.77399826049805   3.890000104904175 1 0 10.802083015441895   .274301677942276 2006
                                          93   67.4229965209961   4.670000076293945 1 0 11.089759826660156 .26995888352394104 2007
                                        85.5  69.78199768066406   4.800000190734863 1 0 10.984394073486328 .24110981822013855 2008
                                         123 33.742000579833984  3.5199999809265137 1 0 11.863561630249023  .3924040198326111 2009
                                         105  33.20199966430664   4.340000152587891 1 0 11.970982551574707  .4792945981025696 2010
                                          90  34.95000076293945                3.75 1 0 11.822540283203125  .4600101113319397 2011
                                          92 38.744998931884766   4.164000034332275 1 0 11.549758911132813 .49203941226005554 2012
                            85.0999984741211 40.770999908447266  3.2100000381469727 1 0 11.526226997375488  .4848041534423828 2013
                           94.38999938964844  36.75899887084961  2.3420000076293945 1 0 11.576603889465332  .5072281956672669 2014
                                        11.5  5.374000072479248  1.4199999570846558 1 0 10.475540161132812   .616122841835022 2008
                                        11.5  5.374000072479248  1.3700000047683716 1 0 10.606882095336914  .5222367644309998 2009
                                          23  6.256999969482422  1.4600000381469727 1 0 10.966300010681152    .51717209815979 2010
                                          28  7.077000141143799  1.7400000095367432 1 0 11.262731552124023    .60068678855896 2011
                          20.799999237060547  7.611999988555908  1.5399999618530273 1 0 11.520615577697754  .6119232177734375 2012
                          19.989999771118164  6.880000114440918   .6230000257492065 1 0 11.269821166992188  .6542901992797852 2013
                                        19.5  6.443999767303467   .5120000243186951 1 0 11.142687797546387  .6542901992797852 2014
                          170.25999450683594 324.58099365234375  32.470001220703125 0 0 10.868568420410156 .30800336599349976 2000
                          178.77000427246094  307.5350036621094  21.739999771118164 0 0  10.71241569519043 .37766191363334656 2001
                          164.94000244140625    292.35400390625               16.75 0 0 10.714417457580566 .40556439757347107 2002
                          148.97000122070312  294.2149963378906  10.210000038146973 0 0 10.680516242980957 .34025633335113525 2003
                           136.2100067138672    284.85400390625  14.579999923706055 0 0 10.666626930236816  .3694266080856323 2004
                          148.97000122070312  327.6189880371094  14.170000076293945 1 0 10.645781517028809  .2555486559867859 2005
                                         190 312.84698486328125  14.569999694824219 1 0 10.824766159057617 .23705239593982697 2006
                                         162 300.74700927734375  16.059999465942383 1 0 10.976781845092773  .2432396113872528 2007
                                         100  297.8030090332031  3.7699999809265137 1 0 10.524064064025879 .21141640841960907 2008
                                         285 301.29901123046875   7.039999961853027 1 0 10.552369117736816  .1948442906141281 2009
                                         425  333.7969970703125  32.470001220703125 1 0 11.561716079711914 .21381297707557678 2010
                                         505 347.52398681640625                26.5 1 0  11.76756763458252 .19481472671031952 2011
                                         505 343.28399658203125    14.9399995803833 1 0 11.970982551574707  .2013818919658661 2012
                                         475 347.52398681640625   10.54800033569336 1 0 11.959532737731934 .21383869647979736 2013
                                         435  325.9179992675781 -1.0160000324249268 1 0 11.547327041625977 .19481472671031952 2014
                                          34 19.031999588012695  1.4839999675750732 0 0 11.394142150878906  .7818297147750855 2000
                           24.06999969482422 20.097000122070312               1.625 0 0   11.2489595413208   .750066876411438 2001
                                          14 15.423999786376953  -4.673999786376953 0 1 10.778956413269043  .7772271037101746 2002
                          14.319999694824219 13.937000274658203 -1.5390000343322754 0 1 10.425846099853516  .7922587990760803 2003
                          22.200000762939453 15.159000396728516  1.3819999694824219 0 1 10.511076927185059  .8102107644081116 2004
                            21.8700008392334 17.990999221801758  1.5609999895095825 1 1 11.021902084350586  .7979986667633057 2005
                                          29 20.111000061035156   2.740000009536743 1 0 10.690125465393066  .7927110195159912 2006
                                          23 23.695999145507813   4.130000114440918 1 1 10.936387062072754   .764927864074707 2007
                          14.949999809265137 27.027999877929687   4.170000076293945 1 1 10.422281265258789  .7493062615394592 2008
                          18.510000228881836  32.15700149536133   5.230000019073486 1 1  10.55581283569336  .7429019808769226 2009
                          29.299999237060547  37.74399948120117   6.820000171661377 1 1 11.115785598754883  .7141793370246887 2010
                                          25 41.446998596191406   5.139999866485596 1 1  10.93167781829834  .7164605855941773 2011
                           33.61000061035156 45.792999267578125   4.539999961853027 1 1 11.122546195983887  .6829836964607239 2012
                                        38.5 47.082000732421875    3.76200008392334 1 1 11.496308326721191  .6641556620597839 2013
                          30.010000228881836  39.01499938964844  -4.673999786376953 1 1  11.32447338104248  .7200075387954712 2014
                          23.760000228881836 10.074999809265137   2.430000066757202 0 0 10.301189422607422  .6283410787582398 2000
                                          31  11.75100040435791  2.4800000190734863 0 0 10.214201927185059  .5854455828666687 2001
                                        26.5 13.616999626159668   2.740000009536743 0 1 10.355677604675293  .5498139262199402 2002
                           34.97999954223633 15.789999961853027  3.0799999237060547 0 1 10.566587448120117  .5290476679801941 2003
                           40.29999923706055 18.606000900268555  3.4100000858306885 0 1 10.741881370544434  .4863479435443878 2004
                           54.04999923706055 24.030000686645508  3.5999999046325684 1 1 10.988508224487305  .4226541221141815 2005
                          55.599998474121094 27.107999801635742  3.9800000190734863 1 0 11.148390769958496  .4494249224662781 2006
                                          51 30.687999725341797   4.300000190734863 1 1 11.166681289672852  .4107557237148285 2007
                                          44   31.7549991607666  3.5399999618530273 1 1 10.753296852111816 .46678656339645386 2008
                            49.5099983215332  37.62300109863281   6.389999866485596 1 1 10.901542663574219 .38681212067604065 2009
                          54.400001525878906   43.3489990234375   6.190000057220459 1 1 11.055988311767578 .37238818407058716 2010
                                          44 46.132999420166016   4.460000038146973 1 1 10.944329261779785  .3957982361316681 2011
                            55.9900016784668  51.25299835205078   5.170000076293945 1 1 11.047248840332031  .3653583526611328 2012
                                        67.5 53.560001373291016   5.730000019073486 1 1  11.29562759399414 .42706480622291565 2013
                           84.19999694824219  56.64699935913086   6.059999942779541 1 1 11.389830589294434  .4648688733577728 2014
                          11.065299987792969 11.154000282287598  .17399999499320984 0 0  10.31692123413086  .5094398856163025 2000
                            7.93120002746582 10.335000038146973  -.9710000157356262 0 0  9.880884170532227  .5481069684028626 2001
                           7.061299800872803  9.762999534606934  -.3019999861717224 0 1  9.598184585571289  .5554723739624023 2002
                           9.722100257873535  9.109999656677246 -.30000001192092896 0 1  9.954180717468262  .5210447311401367 2003
                          13.815699577331543   8.87600040435791  .17399999499320984 0 1 10.235485076904297  .5311435461044312 2004
                          13.239999771118164 11.777000427246094  1.5240000486373901 1 1 10.467294692993164   .408922016620636 2005
                           13.35569953918457 11.067000389099121   .7760000228881836 1 0 10.295124053955078 .39476579427719116 2006
                            11.1181001663208 10.876999855041504  .23100000619888306 1 1 10.370329856872559  .4648481607437134 2007
                            9.78950023651123  10.92300033569336   .4269999861717224 1 1  9.899680137634277 .43737274408340454 2008
                           9.369999885559082 10.411999702453613   .2939999997615814 1 1  9.940542221069336 .43595319986343384 2009
                           9.964300155639648 10.902000427246094   .6290000081062317 1 1  9.968151092529297  .3951820433139801 2010
                           8.978400230407715  10.58899974822998   .2590000033378601 1 1  9.941312789916992  .4825488328933716 2011
                           5.629000186920166   9.53499984741211  .04899999871850014 1 1  9.848397254943848  .4663146436214447 2012
                                          25  6.258999824523926  1.5230000019073486 0 0 11.589043617248535  .7812426686286926 2000
                          27.059999465942383  7.947999954223633  1.8200000524520874 0 0 11.549826622009277  .7354952692985535 2001
                                       35.75  9.152000427246094   2.509999990463257 0 1  11.56372356414795  .7094526290893555 2002
                                          58 13.156999588012695   4.070000171661377 0 1 12.181093215942383  .6351710557937622 2003
                          55.849998474121094 15.531000137329102                2.75 0 1 12.272529602050781  .6319843530654907 2004
                                          66  25.26799964904785   2.559999942779541 1 1 12.505335807800293  .5654600858688355 2005
                                          75   28.7450008392334   4.199999809265137 1 0 12.535638809204102  .5296328067779541 2006
                                          68 32.709999084472656   4.840000152587891 1 1 12.641746520996094  .4756329655647278 2007
                          54.310001373291016 30.594999313354492 -1.0299999713897705 1 1 12.319931983947754 .46572303771972656 2008
                          61.900001525878906  33.36899948120117  3.5399999618530273 1 1 12.356121063232422  .4099482297897339 2009
                                        56.5 21.465999603271484  3.0799999237060547 1 1 12.313427925109863  .5323699712753296 2010
                          63.060001373291016  22.58099937438965  2.0999999046325684 1 1 12.338279724121094  .5342318415641785 2011
                           60.65999984741211 23.950000762939453  2.1559998989105225 1 1 12.600506782531738  .5017018914222717 2012
                            71.4800033569336 25.434999465942383  2.8369998931884766 1 1 12.568672180175781   .529812216758728 2013
                                          80 28.415000915527344   4.005000114440918 1 1 12.607613563537598  .5209482312202454 2014
                           7.989999771118164  8.427000045776367  1.0520000457763672 0 0  9.393911361694336  .6266568899154663 2000
                           4.909999847412109  7.396999835968018  -1.003000020980835 0 0  9.104979515075684  .6231445670127869 2001
                           5.050000190734863  8.041000366210938   .9359999895095825 0 1  9.104979515075684   .640369713306427 2002
                                         7.5  8.109000205993652   .8289999961853027 0 1  9.104979515075684  .5699536800384522 2003
                          19.799999237060547  8.307000160217285  2.4609999656677246 0 1  9.878170013427734  .6321595907211304 2004
                          end
                          format %ty YEAR

                          Code:
                          xtreg wPJUN i.IFRS##SMARKETDUMMY##c.(wEPS wBVPS) wSIZE wLEV i.YEAR, fe
                          Code:
                          margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean(wEPS))) noestimcheck pwcompare(effects)
                          Code:
                          invalid at() specification;
                          unmatched open parenthesis
                          r(198);




                          Comment


                          • #14
                            Ah, looks like I got a little carried away with parentheses and used too many. It's:

                            Code:
                            margins IFRS, dydx(wBVPS) at(SMARKETDUMMY = 1 (mean) wEPS) noestimcheck pwcompare(effects)
                            This now runs with your example data in my set up. (Well, almost: in your example data there is no grouping variable corresponding to the fixed effects. Or, if there is, it isn't obvious to me which one it is. So I just made up a grouping variable and used that to test the code. This -margins- command will run properly now.

                            Comment


                            • #15
                              Sorry, I have forgotten to add ID variable in -dataex- command. Now the -margins- command run properly in my full dataset also.

                              Thank you very much again for your kind help. I have learnt lots of things in such a short time thanks to you.

                              Comment

                              Working...
                              X