Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: how to calculate the accumulative work experience for panel data |

Date |
Thu, 17 Feb 2011 18:49:46 +0000 |

OK. Here's a start. I note first that in your sample data you have two observations with id == 7, jobid == 1. First I drop one drop in 20 Then I -reshape long- reshape long j_, i(id jobid) string The number of jobs currently held is bysort id (j_) : gen nojobs = sum((_j == "sta") - (_j == "sto")) You now need to subtract off the gaps when there was no job from the total length of employment. On Thu, Feb 17, 2011 at 5:11 PM, Hey Sky <heyskywalker@yahoo.com> wrote: > for the cumulative work exp, no matter how many jobs they hold simutaneously, I > only count them served in employment. that is, only count the overlapping time > once. > > From: Nick Cox <n.j.cox@durham.ac.uk> > > I think we need -- correction, I need -- your definition of accumulated or > cumulative work experience. (By the way, I suggest either word, not > accumulative.) > > Do you or do you not count time served simultaneously in two or more jobs with > that much weight or you just count time served in employment? Hey Sky > yesterday I post a question on how to calculate the mean wage under panel data. > > thanks for David valuable suggestions. the tested code are as above. > > now I have another question about panel data: how to calculate the accumulative > > work experience while getting rid off the overlapping period? > > > example data as follows, the j_sta/j_sto represents job starting/stoping time > and id, as before, represents the people who participates in survey. > > > as you can see, the various overlapping situation make it hard to entangle and > get the right work experience. for id=1, a perfect situation that he start his > 2nd job after finished his 1st one. for id=2, even there is an overlapping > period between his 1st and 2nd job, it is not hard to get accumulative exp > right. > > > now consider a little more complicated case for 3 or more jobs. such as id=3, > overlapping between 1st and 2nd but not 3rd job. for id=7, his all 3 jobs are > overlapped. now take a look at id=5, though there is no overlapping between his > > 1st and 3rd job, his 2nd job are totally covered by his 3rd job. id=6 is in a > similar situation with overlapping between 1st and 3rd job. > > any suggestions are appreciated. > > > > **** Tested code to get mean wage under panel data **** > clear > input id jobid wage1 wage2 wage3 j_sta j_sto > 1 1 1 2 . 1000 1050 > 1 2 . 3 . 1055 1260 > 2 1 1 . . 1000 1050 > 2 2 . 2 2 1022 1240 > > 3 1 1 2 . 1000 1050 > 3 2 . 3 . 1030 1150 > 3 3 . . 4 1155 1280 > > 4 1 2 . . 1000 1050 > 4 2 . 3 4 1070 1150 > 4 3 . . 5 1160 1240 > > 5 1 1 . . 1000 1050 > 5 2 . 2 3 1080 1100 > 5 3 . . 5 1040 1290 > > 6 1 1 . . 1000 1050 > 6 2 . 2 3 1080 1100 > 6 3 . . 5 1060 1290 > > 7 1 2 2 . 1000 1050 > 7 2 . 2 3 1040 1110 > 7 3 . . 5 1100 1250 > > 7 1 2 4 6 1020 1270 > 8 1 2 3 . 1001 1210 > 9 1 2 . 4 1033 1244 > > end > > > format j_sta j_sto %td > > **** suggested by David **** > reshape long wage, i(id jobid) j(wave) > > drop if mi(wage) > sort id wave jobid > by id wave (jobid): keep if _n==_N > > by id: egen meanwage = mean(wage) > *************** * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**Re: st: RE: how to calculate the accumulative work experience for panel data***From:*Hey Sky <heyskywalker@yahoo.com>

**References**:**st: how to calculate the accumulative work experience for panel data***From:*Hey Sky <heyskywalker@yahoo.com>

**st: RE: how to calculate the accumulative work experience for panel data***From:*Nick Cox <n.j.cox@durham.ac.uk>

**Re: st: RE: how to calculate the accumulative work experience for panel data***From:*Hey Sky <heyskywalker@yahoo.com>

- Prev by Date:
**RE: st: A bug in egen and gen?** - Next by Date:
**Re: re:st: pscore question** - Previous by thread:
**Re: st: RE: how to calculate the accumulative work experience for panel data** - Next by thread:
**Re: st: RE: how to calculate the accumulative work experience for panel data** - Index(es):