Hi! This is my first post so I apologize in advance if I violate anything.
I'm struggling to put what I want to ask into words so here's an illustration of my current (panel) data:
So what I want to do is copy Description data to blank observations (in other years) that has exactly the same Name.
Here's what I'm trying to achieve:
The underlined entries under Description are the changes I want to be made.
So what I'm trying to achieve is that a Description entry from a certain Year be copied to another year that has no Description, if the Name is the same.
Notes*
The entries under variable Name are not consistent across years (Name A may appear in Year 2016, 2015, and 2014, but not in 2013 and so on)
I can manually tag them but the data is too big. I'm trying to fill 5000 entries, so I hope there is a way to automate it.
Please let me know if more information is needed. Help would really be appreciated. Thank you!
I'm struggling to put what I want to ask into words so here's an illustration of my current (panel) data:
Name | Year | Description |
A | 2016 | Oil |
B | 2016 | Oil |
C | 2016 | Gas |
D | 2016 | Wood |
A | 2015 | |
B | 2015 | |
C | 2015 | |
A | 2014 | |
B | 2014 |
Here's what I'm trying to achieve:
Name | Year | Description |
A | 2016 | Oil |
B | 2016 | Oil |
C | 2016 | Gas |
D | 2016 | Wood |
A | 2015 | Oil |
B | 2015 | Oil |
C | 2015 | Gas |
A | 2014 | Oil |
B | 2014 | Oil |
So what I'm trying to achieve is that a Description entry from a certain Year be copied to another year that has no Description, if the Name is the same.
Notes*
The entries under variable Name are not consistent across years (Name A may appear in Year 2016, 2015, and 2014, but not in 2013 and so on)
I can manually tag them but the data is too big. I'm trying to fill 5000 entries, so I hope there is a way to automate it.
Please let me know if more information is needed. Help would really be appreciated. Thank you!
Comment