Thank you Clyde Schechter. Seriously. I appreciate your help with the code. I note an issue that arises below (id 174 & 175), I refer to #25 where I tried to account for the case where one in a couple state they are separated (marstat==3), in such cases, end should '=1' in the preceeding year (wave==6, not 7), see below:
With respect to duration, Would it be correct to counts the rare missing as in wave 14 below, so duration equals 18? If so, what would the rule be for this - a limit of 1-2 continuous missings within, not at start/end, of panels - your thoughts?
For a meaningful analysis, I think I should only include a minimum number of continuous observations (e.g. 3), unless spells<3 start and end in that period. Does this sound reasonable?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long(id p_id) byte(wave marstat p_marstat begin end) 174 175 1 1 1 1 0 174 175 2 1 1 0 0 174 175 3 1 1 0 0 174 175 4 . 1 0 0 174 175 5 . 1 0 0 174 175 6 . 1 0 0 174 175 7 . 3 1 0 175 174 1 1 1 1 0 175 174 2 1 1 0 0 175 174 3 1 1 0 0 175 174 4 1 . 0 0 175 174 5 1 . 0 0 175 174 6 1 . 0 0 175 174 7 3 . 1 1 175 1227 12 2 . 1 0 175 1227 13 2 . 0 0 175 1227 14 2 . 0 0 175 1227 15 2 . 0 0 175 1227 16 2 . 0 0 175 1227 17 2 . 0 0 175 1227 18 2 . 0 0 end
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input longid p_id) byte(wave marstat p_marstat begin end) float duration 128 129 1 1 1 1 0 17 128 129 2 1 1 0 0 17 128 129 3 1 1 0 0 17 128 129 4 1 1 0 0 17 128 129 5 1 1 0 0 17 128 129 6 1 1 0 0 17 128 129 7 1 1 0 0 17 128 129 8 1 1 0 0 17 128 129 9 1 1 0 0 17 128 129 10 1 1 0 0 17 128 129 11 1 1 0 0 17 128 129 12 1 1 0 0 17 128 129 13 1 1 0 0 17 128 129 15 1 1 0 0 17 128 129 16 1 1 0 0 17 128 129 17 1 1 0 0 17 128 129 18 1 1 0 0 17 end
Comment