Hello. I am a total newbie with Stata. Almost zero, but even though i have to use this program for my thesis, meaning i have to master it before starting my project.
The problem that i have is (if i can explain it properly in Stata key words):
I have a set of 5000 companies. With different variables (for ex: Net Income, Equity, Assets and so on), i have put the data in panel form i think.
At least it is divided by ID and Year. Meaning i have 5000 companies separated by ID, with variables between 2009 and 2013 ready to be used.
When i try to do the lagged values i couldnt use this expression:
"generate lagROE=lROE" and it gave me the error: "nothing found where name expected"
So , i tried to do some more research on web about this issue before resorting for last measures and i managed to do this:
"generate lROE=ROE[_n-1]" and it gave me the lagged values yes. The first year 2009 doesnt show because we dont have any value for 2008. the 2010 is 2009 , 2011 is 2012 is 2011 and so n.
Thats correct FOR THE FIRST COMPANY. Then the lagged values for the next company of 2009 is the value of 2013 of the previous company.
Do you see the error here? The next company, it should have no value for 2009 , and not being the 2013 value of the previous company.
Important to say that i estimated ROE by myself doing generate ROE: NetIncome/Equity for ex
Also the panel view was done doing:
sort ID Year
thank you very much.If you want i can attach the stata file.
thank you again and very sorry for the dumb question.
The problem that i have is (if i can explain it properly in Stata key words):
I have a set of 5000 companies. With different variables (for ex: Net Income, Equity, Assets and so on), i have put the data in panel form i think.
At least it is divided by ID and Year. Meaning i have 5000 companies separated by ID, with variables between 2009 and 2013 ready to be used.
When i try to do the lagged values i couldnt use this expression:
"generate lagROE=lROE" and it gave me the error: "nothing found where name expected"
So , i tried to do some more research on web about this issue before resorting for last measures and i managed to do this:
"generate lROE=ROE[_n-1]" and it gave me the lagged values yes. The first year 2009 doesnt show because we dont have any value for 2008. the 2010 is 2009 , 2011 is 2012 is 2011 and so n.
Thats correct FOR THE FIRST COMPANY. Then the lagged values for the next company of 2009 is the value of 2013 of the previous company.
Do you see the error here? The next company, it should have no value for 2009 , and not being the 2013 value of the previous company.
Important to say that i estimated ROE by myself doing generate ROE: NetIncome/Equity for ex
Also the panel view was done doing:
sort ID Year
thank you very much.If you want i can attach the stata file.
thank you again and very sorry for the dumb question.
Comment