Announcement

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

  • regression of the panel data: dependent variable and independent variable is the same variable in different group

    Hi, I am now running a panel regression, for example, return in year 2018=c+return in year 2010-2017+e. And year 2010-2017 is categorized as group 1, year 2018 is group 0. as attached.
    year group return
    2010 1 10
    2011 1 11
    2012 1 12
    2013 1 13
    2014 1 14
    2015 1 15
    2016 1 16
    2017 1 17
    2018 0 18
    I try to generate the new variables return1 and return2:

    gen return1=0
    gen return2=0
    replace return1=reutrn if group==1
    replace return2=return if group==0

    then run the regression reg return2 return1

    however, the result is contradictory to the cross section one and seems contradictory to the economic intuition.

    Any comments to my solution? how should I do this?

    Thank you and best,
    Ivy
    Last edited by Ivy Zhu; 30 Nov 2018, 05:00.

  • #2
    First, the code you show produces no results at all, counterintuitive or otherwise. It gives an error message at the -replace return1 = ...- command because there is no variable reutrn in your data set. It is important when asking people to troubleshoot code to show the actual code you ran. This should be done by copying and pasting from your do file. When you re-type code you can introduce unintended changes, and those just confuse the picture. Please read the Forum FAQ for more advice about the best ways to show code, results, and example data and take them to heart in your future posts.

    After correcting the typo in that statement, your code implements a data model and regression that doesn't make any sense to me. But I can't offer specific advice on how to improve it because I don't understand from your post what you actually are trying to do. If the goal is to try to model the 2018 return as a linear function of the returns from 2010 through 2017, then you need to -reshape- the data to wide form and then -reg return2018 return2010-return2017-. But, it is unclear, then, what the variable group has to do with anything. Also, you would have only a single observation, unless you have a whole series of observations each of which resembles what you have shown as an example, but each corresponds to some different firm.

    All of that said, and going beyond my area of expertise, regressing return2018 against return2010-return2017 sounds like an invitation to considerable trouble due to serial correlation in the return series itself. I believe there are special commands for handling this kind of thing, like Arellano-Bond estimation, but I don't really know how to use them and can't advise you.

    Comment

    Working...
    X