HI,
Would someone be able to help me with a code for how to identify a viable within a date interval. In short I have a dataset in which I I have an exposure date (injury date) and outcome which is sickness absence. I look at new sickness absence cases and identify them by register data from one one, in which I can see the first day of the sickness absence spell (SAstart) and the last day of the spell (SAend). Each person in the dataset can have multiple sickness absence spells starting within a given time period. So far all good. However, I would like to create a variable which states which of the sickness spells is on the day of the injury, eg for ID 1 it might be SAstart5, for ID2 it might be SAstart5 aso. Since we have data for the whole year it is not given that the persons first sickness absence is in relation to the exposure, they can have had a sickness absence spell before the injury during that year as well. the data is in wide format att he moment.
persons are identified by ID
then each person has variables injury date1, SAstart1 (to SAstart225, however only few persons have that many), SAend1 (to 225).
So, how do I identify which one of the spells does the exposure occur?
grateful for any assistance.
Related Posts with How do I identify a variable within a date interval
Creating portfolios with double sorting and calculating mean returns of the portfolios.(please help)This is the third time I write this topic but did not get any answer from statalists members, and ca…
nscale: new package for rescaling variables to run from 0 to 1 now available on SSCThanks to Kit Baum, a new package called nscale is now available on SSC archive. Code: . ssc insta…
xtbcfe erroeDear All, I am trying to use the user written routine xtbcfe for bias corrected fixed effect estima…
Values of Coefficient and Power of Test in Data EditorHello, I am using the following command "bysort var: reg y x". In doing so, I get many results. Fo…
How to convert -mixed- to -gsem-Does anyone know how to convert a 3-level model with random-effects and random slopes from by -mixed…
Subscribe to:
Post Comments (Atom)
0 Response to How do I identify a variable within a date interval
Post a Comment