I'm working with a panel data set consisting of 659 individuals who I track over different periods of time between 2004 and 2012, i.e. some individuals are tracked for 9 years (2004-2012) while others are tracked 3 years (for example 2004-2006) and so on. I have generated a duration variable, which records for how long they have been tracked and places this value into the 2004 slot for each individual. So my data set looks like this:
In fact, my real data looks like this:
And if I make a histogram out of that, then everything is fine. BUT I want the following:
- a histogram (bar chart?) and line chart with cumulative counts so the first bar is 10, the second is 10+53, the third is 10+53+83
- A line chart that goes the other way, so something that shows how many individuals I still have remaining: so the first bar should be 659-10, the second 659-10-53 etc.
I understand that if I just had these numbers in 9 cells, then the matter would be trivial. But right now they're spread out over 659 individuals.
Code:
pid syear duration 111 2004 2 111 2005 . 222 2004 3 222 2005 . 222 2006 .
Code:
duration Freq. Percent Cum. 1 10 1.52 1.52 2 53 8.04 9.56 3 83 12.59 22.15 4 78 11.84 33.99 5 79 11.99 45.98 6 92 13.96 59.94 7 85 12.90 72.84 8 92 13.96 86.80 9 87 13.20 100.00 Total 659 100.00
- a histogram (bar chart?) and line chart with cumulative counts so the first bar is 10, the second is 10+53, the third is 10+53+83
- A line chart that goes the other way, so something that shows how many individuals I still have remaining: so the first bar should be 659-10, the second 659-10-53 etc.
I understand that if I just had these numbers in 9 cells, then the matter would be trivial. But right now they're spread out over 659 individuals.
Comment