Announcement

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

  • Effect of time on the relationship between IV and DV using Panel Data

    Dear all,

    I am using secundary data with a panel data structure (6 years of observation). Basically I am interested in the effect of employee share ownership (ESO), i.e. number of stocks employees purchase from their employer annualy, on employee individual work behavior (IWB), i.e. number of ideas an employee has issued to a corporate idea suggestion scheme per year.

    My data has the following structure:
    ID YEAR ESO (IV) Several Controls IWB (DV)
    1 1 10 1
    1 2 15 2
    1 3 0 0
    1 4 10 0
    1 5 22 4
    1 6 10 0
    2 1 0 2
    2 2 0 1
    ... ... ... ... ...

    Based on the idea of dimishing marginal utility, I am expecting the effect of ESO on IWB to decrease over time. Hence, I would like to calculate and plot the relationship between ESO and IWB for each of the 6 years of observation to show how the relationship changes over time. Unfortuantely, I have not found a lot of advise on how to adress this. One of the few approaches that I have found is explained here (http://www.fight-entropy.com/2010/11...lity-over.html) but the script is not available for download anymore.

    I would very much apprechiate any kind of advise on how to investigate how the relationship between ESO and IWB changes over time.

    Kind regards

    Felix

  • #2
    Well, you need to be specific about the way in which the effect of eso on iwb will change with time, as the code will have to reflect the model you have in mind. If you anticipate that the effect will decay linearly over time, it would be:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(id year eso iwb)
    1 1 10 1
    1 2 15 2
    1 3  0 0
    1 4 10 0
    1 5 22 4
    1 6 10 0
    2 1  0 2
    2 2  0 1
    end
    
    xtset id year
    xtreg iwbdv c.eso##c.year, fe
    But if you think it will decline over, say, the first four years and then level off, you would need a more complicated model that includes a linear spline. If you have some other model of decay in mind, that, too, would require its own representation.

    In any case, the general principle is that you will need to include in your model some variable(s) that reflect the passage of time, and then the interaction of those with eso. Just what those time-reflecting variables are depends on your model of decay.

    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.

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

    Comment


    • #3
      Another way to do this would be to use year as a indicator (i.year) which will estimate separate parameter for each year on eso.

      But, I'm not sure how diminishing marginal utility translates into a time interaction with eso. I would have thought it mean a non-linear influence of eso on behavior where the marginal influence becomes lower at higher levels of eso. This depends a lot on what you're assuming about employee rationality - I would think a rational analysis of diminishing marginal influence would lead to the non-linear influence of eso. An analysis assuming some form of habituation or reference point might lead to your time effect.

      Comment


      • #4
        Dear Clyde, dear Phil,

        thank you both for your great replys. Following your suggestions I did run my Panel Regression (a) with a linear interaction of YEAR; (b) a ln(x) interaction of YEAR (ln(YEAR)) as I assume the effect of ESO on IWB to decay following a logarithmic utility function (https://tgmstat.wordpress.com/2014/0...function/#ref3) and (c) with YEAR as an indicator (i.YEAR).

        I have attached .txt files of my data (dataex), and the xtreg results tables.

        dataex.txt
        InteractionYEAR_and_lnYEAR.txt
        Indicator_iYEAR.txt

        With regards to (b): Is it correct to use ln(YEAR) in the interaction term when assuming the moderation of YEAR to follow a negative but logarithmic shape?

        With regards to (c): Phil, your Interpretation is right that one would assume that the marginal influence of ESO on IWB becomes lower at higher levels of ESO. As employees can purchase only a very limited number of shares (<22) per year my assumption was that the effect of ESO on IWB may not decay within a single year but over the years the more often employees do in fact participate in ESO. That is why I intended to investigate the effect of ESO on IWB over time (YEARS).
        I did run the regression with i.YEAR but I am not sure if this was what you recommended as I still do not receive single coefficients of ESO for every YEAR but single coefficients for every YEAR on IWB.

        Thanks again for your great support!

        Regards Felix


        Last edited by Felix Hofmann; 05 Mar 2018, 00:36. Reason: Incomplete post

        Comment


        • #5
          The code looks like a correct implementation of what you describe, and the outputs look reasonable. The content is outside of my discipline, so I cannot comment on the reasonableness of choosing a logarithmic model; Phil would be better positioned to comment on that aspect of things.

          I do notice one slightly strange thing in the outputs. In the model where ESO is interacted with YEAR, the YEAR variable is omitted because of colinearity. But in the model using LNYEAR, LNYEAR is not omitted. Perusing the variable list, I'm guessing that the colinearity affecting YEAR, but not LNYEAR, is with TENURE. If that's correct, then there is no problem. But just be sure you understand where it's coming from. I couldn't actually explore it in the example data you provided because in the example YEAR is always 2010.

          In the future, rather than making text file attachments out of your -dataex- output and the Results window, just copy/paste those directly into the forum editor between code delimiters. (For the -dataex- output you don't even have to create your own code delimiters because they are part of the -dataex- output itself, so it's just a straight copy/paste.) It'll save you time and trouble, and it'll also be quicker on the receiving end as well.

          Comment


          • #6
            Dear Clyde, thanks for your help! As TENURE and YEAR increase by 1unit each YEAR, I guess you are right that YEAR is omitted due to collinearity with TENURE.

            I am now running my model with time fixed effects and robust and clustered standard errors. Overall it looks fine but I am wondering why YEAR_LN and 6.YEAR are omitted? GENDER is omitted because it does not vary over time.

            See datext and results below.

            Thanks! Felix

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input double(NEWIDEA_A GENDER TENURE FULLTIME) float(DUMMY_FUNCTION_1 DUMMY_FUNCTION_2 DUMMY_LEVEL_1 DUMMY_LEVEL_2 DUMMY_LEVEL_3) double(SIZE NUMBEROTHER NUMBERESO) float YEAR_LN double ESO_REMAININGTEAM
            0 0 14 1 0 0 1 0 0 18 100  0         0  .3333333333333333
            0 0 15 1 0 0 1 0 0 18   0 22  .6931472                 .5
            0 0 16 1 0 0 1 0 0 19   0 22 1.0986123  .2631578947368421
            0 0 17 1 0 0 1 0 0 20   0 22 1.3862944                 .3
            0 0 18 1 0 0 1 0 0 19   0  0  1.609438 .10526315789473684
            0 0 19 1 0 0 1 0 0 21   0  0 1.7917595 .04761904761904762
            0 0 30 1 0 1 0 1 0  5   0  0         0                  0
            0 0 31 1 0 1 0 1 0  5   0  0  .6931472                 .4
            0 0 32 1 0 1 0 1 0  6   0  0 1.0986123 .16666666666666666
            0 0 33 1 0 1 0 1 0  5   0  0 1.3862944                 .2
            0 0 34 1 0 1 0 1 0  6   0  0  1.609438  .3333333333333333
            0 0 35 1 0 1 0 1 0  6   0  0 1.7917595 .16666666666666666
            0 0 13 1 1 0 0 0 1 11   0  0         0 .09090909090909091
            0 0 14 0 1 0 0 0 1  6   0  0  .6931472 .16666666666666666
            0 0 13 1 0 0 0 0 0 46   0  0         0 .08695652173913043
            0 0 14 1 0 0 0 0 0 49   0  0  .6931472 .08163265306122448
            0 0 15 1 0 0 0 0 0 40   0  0 1.0986123                .05
            0 0 16 1 0 0 0 0 0 43   0  0 1.3862944 .09302325581395349
            0 0 17 1 0 0 0 0 0 35   0  0  1.609438 .14285714285714285
            0 0 18 1 0 0 0 0 0 33   0  0 1.7917595 .09090909090909091
            0 0 13 1 0 1 0 0 1  1   0  0         0                  0
            0 0 14 0 0 1 0 0 1  2   0  0  .6931472                  0
            0 0 15 0 0 1 0 0 1  1   0  0 1.0986123                  0
            0 0 16 0 0 1 0 0 1  1   0  0 1.3862944                  0
            0 0 17 0 0 1 0 0 1  1   0  0  1.609438                  0
            0 0 18 0 0 1 0 0 1  1   0  0 1.7917595                  0
            2 0 12 1 0 0 0 0 0 29   0  0         0                  0
            3 0 13 1 0 0 0 0 0 30   0  0  .6931472 .03333333333333333
            1 0 14 1 0 0 0 0 0 29   0  0 1.0986123                  0
            2 0 15 1 0 0 0 0 0 29   0  0 1.3862944                  0
            6 0 16 0 0 0 0 0 0 30   0  0  1.609438 .03333333333333333
            2 0 17 0 0 0 0 0 0 30   0  0 1.7917595 .03333333333333333
            0 1 12 1 0 1 0 1 0  4   0  0         0                 .5
            0 1 13 1 0 1 0 1 0  4   0  0  .6931472                  0
            0 1 14 1 0 1 0 1 0  2   0  0 1.0986123                  0
            0 1 15 1 0 1 0 1 0  5   0  0 1.3862944                 .2
            0 1 16 1 0 1 0 1 0  5   0  0  1.609438                 .6
            0 1 17 0 0 1 0 1 0  7   0  0 1.7917595  .2857142857142857
            0 1 12 0 0 1 0 1 0  7   0  0  .6931472  .2857142857142857
            0 1 13 0 0 1 0 1 0  7   0  0 1.0986123  .2857142857142857
            0 1 14 0 0 1 0 1 0  9   0  0 1.3862944  .2222222222222222
            0 1 15 0 0 1 0 1 0  8   0  0  1.609438                .25
            0 1 16 0 0 1 0 1 0  9   0  0 1.7917595  .2222222222222222
            0 0 10 1 0 1 0 0 1 10   0  0         0                 .2
            0 0 11 1 0 1 0 0 1  8   0  0  .6931472               .375
            0 0 12 1 0 1 0 0 1  6   0  0 1.0986123                 .5
            0 0 13 1 0 1 0 0 1  8   0  0 1.3862944               .375
            0 0 14 1 0 1 0 0 1  9   0  0  1.609438  .2222222222222222
            0 0 15 1 0 1 0 0 1 11   0  0 1.7917595 .36363636363636365
            0 0 11 1 0 1 0 1 0  6   0  0         0 .16666666666666666
            0 0 12 1 0 1 0 1 0  5   0  0  .6931472                 .2
            0 0 13 1 0 1 0 1 0  6   0  0 1.0986123 .16666666666666666
            0 0 14 1 0 1 0 1 0  6   0  0 1.3862944 .16666666666666666
            0 0 15 1 0 1 0 1 0  6   0  0  1.609438 .16666666666666666
            0 0 16 1 0 1 0 1 0  6   0  0 1.7917595 .16666666666666666
            0 1 11 1 0 1 0 1 0  8   0  0         0               .125
            0 1 13 0 0 1 0 1 0  7   0  0 1.0986123 .14285714285714285
            0 1 14 1 0 1 0 1 0  6   0  0 1.3862944 .16666666666666666
            0 1 15 1 0 1 0 1 0  6   0 11  1.609438 .33333333333333337
            0 1 16 1 0 1 0 1 0  6   0  0 1.7917595                  0
            0 1 11 1 1 0 0 1 0 10   0 20         0                  0
            0 1 12 1 1 0 0 1 0 10   0 22  .6931472                 .1
            0 1 13 1 0 0 0 0 1  1   0 22 1.0986123                  0
            0 1 14 1 0 0 0 0 1  1   0 22 1.3862944                  0
            0 1 11 1 0 0 0 0 1  8   0  0         0                .25
            0 1 12 1 0 0 0 0 1  6   0  0  .6931472  .3333333333333333
            0 1 13 1 0 0 0 0 1  6   0  0 1.0986123  .3333333333333333
            0 1 14 1 0 0 0 0 1  6   0  0 1.3862944  .3333333333333333
            0 0 14 1 0 1 0 1 0  2   0  0 1.0986123                  0
            0 0 15 1 0 1 0 1 0  3   0  0 1.3862944                  0
            0 0 16 1 0 1 0 1 0  2   0  0  1.609438                  0
            0 0 17 1 0 1 0 1 0  6   0  0 1.7917595 .16666666666666666
            0 1 13 1 0 1 0 1 0 14   0  0  .6931472  .2857142857142857
            0 1 14 1 0 1 0 1 0 13   0  0 1.0986123  .3076923076923077
            0 1 15 1 0 1 0 1 0  5   0  0 1.3862944                 .4
            0 1 17 0 0 1 0 1 0  6   0  0 1.7917595 .16666666666666666
            0 0  6 1 0 1 0 0 1  5   0  0         0                  0
            0 0  7 1 0 1 0 0 1  5   0 42  .6931472                 .2
            1 0  8 1 0 1 0 0 1  6   0 42 1.0986123 .16666666666666666
            0 0  9 1 0 1 0 0 1  6   0 22 1.3862944                  0
            0 0 10 1 0 1 0 0 1  5   0 22  1.609438                  0
            0 0 11 1 0 1 0 0 1  5   0 11 1.7917595                 .2
            0 0 20 1 0 1 0 0 1  1   0  0 1.7917595                  0
            0 0 11 1 0 1 0 1 0  3   0  0         0  .3333333333333333
            0 0 12 1 0 1 0 1 0  3   0  0  .6931472  .3333333333333333
            0 0 13 1 0 1 0 1 0  2   0  0 1.0986123                  0
            0 0 14 1 0 1 0 1 0  4   0  0 1.3862944                  0
            0 0 15 1 0 1 0 1 0  2   0  0  1.609438                  0
            0 0 16 1 0 1 0 1 0  2   0  0 1.7917595                  0
            2 1  9 1 0 0 0 1 0 12   0  0         0                  0
            0 1 10 1 0 0 0 1 0 17   0  0  .6931472 .11764705882352941
            3 1 11 1 0 0 0 1 0  4   0  0 1.0986123                .25
            0 1 12 1 0 0 0 1 0 11   0  0 1.3862944 .09090909090909091
            0 1 13 1 0 0 0 1 0 11   0  0  1.609438  .2727272727272727
            0 1 14 1 0 0 0 1 0 11   0  0 1.7917595 .18181818181818182
            0 0 32 1 0 1 0 1 0 20   0  0  .6931472                  0
            0 0 33 1 0 1 0 1 0 20   0  0 1.0986123                  0
            0 0 34 1 0 1 0 1 0 21   0  0 1.3862944 .04761904761904762
            0 0 35 1 0 1 0 1 0 24   0  0  1.609438 .04166666666666666
            0 0 36 1 0 1 0 1 0 11   0  0 1.7917595 .09090909090909091
            end
            label values GENDER GENDER
            label def GENDER 0 "Male", modify
            label def GENDER 1 "Female", modify
            Code:
            . xtreg NEWIDEA_A GENDER TENURE FULLTIME DUMMY_FUNCTION_1 DUMMY_FUNCTION_2 DUMMY_LEVEL_1 DUMMY_LEVEL_2 DUMMY_LEVEL_3 SIZE NUMBEROTHER c.NUMBERESO c.YEAR_LN c.ESO_REMAININGTEAM c.NUMBERESO#c.YEAR_LN c.NUMBERESO#c.ESO_REMAININGTEAM i.YEAR, fe robust cluster(NEWID)
            note: GENDER omitted because of collinearity
            note: YEAR_LN omitted because of collinearity
            note: 6.YEAR omitted because of collinearity
            
            Fixed-effects (within) regression Number of obs = 813014
            Group variable: NEWID Number of groups = 159861
            
            R-sq: within = 0.0008 Obs per group: min = 1
            between = 0.0086 avg = 5.1
            overall = 0.0055 max = 6
            
            F(17,159860) = 22.57
            corr(u_i, Xb) = -0.0565 Prob > F = 0.0000
            
            (Std. Err. adjusted for 159861 clusters in NEWID)
            -------------------------------------------------------------------------------------------------
            | Robust
            NEWIDEA_A | Coef. Std. Err. t P>|t| [95% Conf. Interval]
            --------------------------------+----------------------------------------------------------------
            GENDER | 0 (omitted)
            TENURE | -.0116251 .0015536 -7.48 0.000 -.0146701 -.00858
            FULLTIME | .0345766 .0156684 2.21 0.027 .0038668 .0652864
            DUMMY_FUNCTION_1 | -.0930439 .0334138 -2.78 0.005 -.1585343 -.0275535
            DUMMY_FUNCTION_2 | -.1300317 .029513 -4.41 0.000 -.1878766 -.0721868
            DUMMY_LEVEL_1 | -.1679506 .0289758 -5.80 0.000 -.2247425 -.1111587
            DUMMY_LEVEL_2 | -.361781 .0397246 -9.11 0.000 -.4396404 -.2839217
            DUMMY_LEVEL_3 | -.479656 .0577313 -8.31 0.000 -.5928082 -.3665038
            SIZE | .0002035 .0000832 2.45 0.014 .0000405 .0003665
            NUMBEROTHER | -.0000341 .000038 -0.90 0.369 -.0001085 .0000403
            NUMBERESO | .0063974 .0024543 2.61 0.009 .0015871 .0112078
            YEAR_LN | 0 (omitted)
            ESO_REMAININGTEAM | -.006247 .016768 -0.37 0.709 -.0391118 .0266179
            |
            c.NUMBERESO#c.YEAR_LN | -.0029518 .0011704 -2.52 0.012 -.0052458 -.0006578
            |
            c.NUMBERESO#c.ESO_REMAININGTEAM | -.0054235 .0038492 -1.41 0.159 -.0129678 .0021208
            |
            YEAR |
            2 | .0298198 .0062966 4.74 0.000 .0174786 .042161
            3 | .044696 .0073666 6.07 0.000 .0302577 .0591343
            4 | .0464757 .0059194 7.85 0.000 .0348739 .0580775
            5 | .0289456 .0046648 6.21 0.000 .0198027 .0380885
            6 | 0 (omitted)
            |
            _cons | .700853 .0423057 16.57 0.000 .6179348 .7837712
            --------------------------------+----------------------------------------------------------------
            sigma_u | 1.5487707
            sigma_e | 1.7162067
            rho | .44885209 (fraction of variance due to u_i)
            -------------------------------------------------------------------------------------------------
            Last edited by Felix Hofmann; 16 Mar 2018, 04:07.

            Comment

            Working...
            X