single observation multi-year variables

#1
Apologies if this has been posted before, but I had difficulties describing the problem.

Rather than having a data set where, for the same entity, I have different observations for different years, I have a data set that has a single observation for a firm but variables are defined by the year. For example it looks like:



I'm not quite sure how to approach this kind of panel data. I'm use entities having multiple observations but a variable indicating they ear. I had intended to just use a fixed effects regression had my data set been assembled in this way, but I'm not sure where to begin with this data.

Any advice would be greatly appreciated.
Will
 
Last edited:
#2
To clarify, output and input would be independent variables with z as a dependent variable. Because output and input are divided by years for each unit of observation, I can't really determine the significance of those variables.
 

Dason

Ambassador to the humans
#3
So it sounds like you should just break your data into the format you expected. What software are you using? Most packages have a way to transfer data from a wide format (what you have) to a long format (what you want).
 

Dason

Ambassador to the humans
#5
There's probably a way to get stata to do what you want but I don't use it so I can't help you out there. I'll move this over to the stata subforum to see if anybody can help.
 
#6
You can do this quite easily in Stata using the reshape command. Your data is currently in wide form, and you probably want it in long form.

Type

help reshape

and the syntax and some examples will come up. I admit I found the syntax a little hard to follow at first, so I created a very small dataset myself just to make sure it was doing what I wanted before using my 'real' data. Let me know how you get on and if I can help you any further.

Stephen
 
#7
You can do this quite easily in Stata using the reshape command. Your data is currently in wide form, and you probably want it in long form.

Type

help reshape

and the syntax and some examples will come up. I admit I found the syntax a little hard to follow at first, so I created a very small dataset myself just to make sure it was doing what I wanted before using my 'real' data. Let me know how you get on and if I can help you any further.

Stephen

Just to add, when using the reshape function you will lose everything in memory except that which is specified in the reshape statement. It makes sense that this is the case, but the first few times you use it this can be a little un-nerving!
 

Dason

Ambassador to the humans
#8
Just to add, when using the reshape function you will lose everything in memory except that which is specified in the reshape statement.
I've never used STATA but it's statements like these that make me wonder why anybody would use STATA over R?
 
#9
I've never used STATA but it's statements like these that make me wonder why anybody would use STATA over R?
I use both personally, they both have their merits at different things. The reshape command can be good, if used correctly.

The obvious real big advantage of R, is that its free. Though STATA isn't horrible expensive. However, I won't start a pros and cons list here :)