+ Reply to Thread
Results 1 to 9 of 9

Thread: Fixed Effects Regression - Dependent Variable Issue

  1. #1
    Points: 76, Level: 1
    Level completed: 52%, Points required for next Level: 24

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Fixed Effects Regression - Dependent Variable Issue




    Hi all,

    I am currently running a fixed effects model in Stata, and have a question regarding how to specify my dependent variable. So I have observations over time for different firms, and I am looking at how changes in 1-year lagged independent variables affect my dependent variable.

    My dependent variable is transaction volume, and occur between 1-3 times per firm. That is, I have all necessary information about my independent variables, but since a firm only engage in these transactions few times over the observation period I have a lot of missing variables. I have added a photo for an example of how the dataset looks like.

    Since these transactions only occur a few times over the life of a firm, is it correct to insert zero's for where they dont do any transactions (I.e. where transaction value is missing)? Or should I run the regressions only on where I have observations for the dependent variable?

    Thanks in advance!
    Attached Images  

  2. #2
    Points: 4,664, Level: 43
    Level completed: 57%, Points required for next Level: 86
    kiton's Avatar
    Location
    Corn field
    Posts
    234
    Thanks
    47
    Thanked 51 Times in 46 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    Hello!

    Firstly, note that transaction volume (as far as I understand) cannot be negative, neither it could be non-integer. Having said that, your DV appears to be a count type and must be treated appropriately -- i.e., either with Poisson (-xtpoisson-) or negative binomial (-xtnbreg-) regression (in case of over-dispersion >1).

    Missing values: are the data simply not available OR were there indeed 0 transactions for the given year? In case of the latter, I believe you could impute a zero instead of missing. In case of the former (i.e., data is not available) -- it is a little more complex. I will be able to provide you a strategy for the latter scenario, once receive an answer to this question.

    Additionally, make sure you meet the assumptions of FE specification.

    Lastly, it looks like your data is in wide format, whereas you'd need to reshape (-reshape- command) it into long in order to run estimation on a panel.
    Last edited by kiton; 07-28-2015 at 08:28 AM.

  3. The Following User Says Thank You to kiton For This Useful Post:

    Magnus MMJ (07-28-2015)

  4. #3
    Points: 76, Level: 1
    Level completed: 52%, Points required for next Level: 24

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    First, thank you very much for your response kiton !

    First, no transaction values are not negative and can be non-integer (3,4 - 6,5 - etc). Although they are all integers in the example I provided they are not so these are not count types (these are measured in mill USD).
    Second, there were indeed 0 transactions for that year! So I have substituted the years were no deals were done with zero's, but then the distribution of the DV would be heavily skewed (many years with zero transactions).

    Also, the assumptions for FE are met (Hausman test). Lastly the data is in long format (to my knowledge?): I.e. it is as the long format here: https://www3.nd.edu/~rwilliam/stats3...-DataSetup.pdf

    So my question is if replacing 0's for the years there were no deal is the way to go? Now I have run the estimation but only on the years when there was a transaction (resulting in very few observation for each entity).

    Suggestions?

    Thank you very much for all your help Kiton !

    Best,
    Magnus

  5. #4
    Points: 4,664, Level: 43
    Level completed: 57%, Points required for next Level: 86
    kiton's Avatar
    Location
    Corn field
    Posts
    234
    Thanks
    47
    Thanked 51 Times in 46 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    Quote Originally Posted by Magnus MMJ View Post
    First, thank you very much for your response kiton !

    First, no transaction values are not negative and can be non-integer (3,4 - 6,5 - etc). Although they are all integers in the example I provided they are not so these are not count types (these are measured in mill USD).
    Ok. I was just double-checkiing

    Quote Originally Posted by Magnus MMJ View Post
    Second, there were indeed 0 transactions for that year! So I have substituted the years were no deals were done with zero's, but then the distribution of the DV would be heavily skewed (many years with zero transactions).
    I would not be concerned with DV distribution then, as regression assumptions are based on the distribution of the residuals (not variables). So, the best way for you to check that out is to examine the Q-Q plot (-qnorm [varname]- in Stata) , for example, of the residual distribution (you want to see a "straight" line out of points).
    As a sort of robustness check for the many zeros that you encounter, check the zero-inflated models.

    Quote Originally Posted by Magnus MMJ View Post
    Also, the assumptions for FE are met (Hausman test).
    Hausman test may indeed indicate your the model fit for either FE or RE. Yet, please consider the following document just to make sure that you are strong methodology-wise: http://www3.nd.edu/~rwilliam/stats3/...edVsRandom.pdf


    Quote Originally Posted by Magnus MMJ View Post
    Lastly the data is in long format (to my knowledge?): I.e. it is as the long format here: https://www3.nd.edu/~rwilliam/stats3...-DataSetup.pdf
    I may have overlooked that in your data example screen shot. Sorry about that. As long as your Stata sets the -tsset- correctly, you are good to go with panel model analysis.


    Quote Originally Posted by Magnus MMJ View Post
    So my question is if replacing 0's for the years there were no deal is the way to go? Now I have run the estimation but only on the years when there was a transaction (resulting in very few observation for each entity).
    My suggestion, considering there were indeed zero transactions for a given company in a given year, would be to go with zeros instead of missing, as otherwise FE will require at least 2 consecutive observations to include them in the analyses, and if there is not enough, then your sample size would be "nothing".

  6. #5
    Points: 76, Level: 1
    Level completed: 52%, Points required for next Level: 24

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    Thanks for your reply (and help!) Kiton! Indeed it seems that putting zero's in for the years is the way to go.

    In terms of the Q-Q plot it does look fairly okay (see attachment)?

    Again, appreciate all your helpful comments!

    Best,
    Magnus
    Attached Images  

  7. #6
    Points: 4,664, Level: 43
    Level completed: 57%, Points required for next Level: 86
    kiton's Avatar
    Location
    Corn field
    Posts
    234
    Thanks
    47
    Thanked 51 Times in 46 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    Magnus,

    Before I say that this is not what you want to see (as this graph indicates non-normal distribution), allow me to double-check if this is a graph for the residuals' distribution and not some variable, as the y-axis is "tv_seo".

    Just to make sure we are on the same page, you first estimate your model, say using Stata, -reg y x1 x2-, then save the residuals, -predict r1, res-, then run the -qnorm r1-.

  8. #7
    Points: 4,664, Level: 43
    Level completed: 57%, Points required for next Level: 86
    kiton's Avatar
    Location
    Corn field
    Posts
    234
    Thanks
    47
    Thanked 51 Times in 46 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    As for the q-q plot, you'd want to see something close to the attached picture.
    Attached Images

  9. The Following User Says Thank You to kiton For This Useful Post:

    Magnus MMJ (07-31-2015)

  10. #8
    Points: 76, Level: 1
    Level completed: 52%, Points required for next Level: 24

    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue

    Kiton,

    My apologies I did not send you the right one. Attached is a plot of the (1) the overall error component e from the fixed effects regression: (-xtreg- -predict res,e-). As I understand this should be normally distributed? Normality does not seem to prevail...

    The second attachment (2) is of the residuals using usual -reg- and not -xtreg-. Again does not seem to be normally distributed? Thoughts?

    Thank you for all your help on this matter Kiton.

    Best,
    Magnus
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	(1).jpg‎
Views:	8
Size:	42.8 KB
ID:	5455   Click image for larger version

Name:	(2).jpg‎
Views:	8
Size:	42.4 KB
ID:	5456  

  11. #9
    Points: 4,664, Level: 43
    Level completed: 57%, Points required for next Level: 86
    kiton's Avatar
    Location
    Corn field
    Posts
    234
    Thanks
    47
    Thanked 51 Times in 46 Posts

    Re: Fixed Effects Regression - Dependent Variable Issue


    Magnus,

    Firstly, please note a private message I sent you.
    Secondly, allow me to double-check: You wrote "(-xtreg- -predict res,e-)" -- prediction of the residuals must be -predict [varname], res-. Otherwise, you could have saved the predicted values, not the residuals.

    If my concern is irrelevant, than distribution is not good. What is the basis for your model -- is it based on theory? How did you come up with the model?

+ Reply to Thread

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats