hi stata users,
Appreciate your help in the matter below
Data set 1- life history of occupations
Data set 2 occupations and gas
Hi all,
I want to merge data set 1 with data set 2 and then write a command that allow me to generate ever/never exposure to gas variable and life time cumulative exposure to gas variable.
Being ever exposed to gas is defined as having at least one occupation with a probability of exposure more than 50%. Individuals who worked only in a occupation with probability of exposure less than 50% to be considered unexposed.
For life time exposure it should be for each time period as the products of probability of exposure, mean level of exposure and duration of occupation in that specific time period. Then exposures over all time periods to be summed for each person.
many thanks for your help.
Appreciate your help in the matter below
Data set 1- life history of occupations
id/Individual | occupation category | Year start | Year end |
C1 | 1 | 1945 | 1950 |
C1 | 2 | 1950 | 1962 |
C2 | 1 | 1965 | 1970 |
C2 | 2 | 1971 | 1978 |
C2 | 3 | 1979 | 1989 |
Data set 2 occupations and gas
Occupation category | Probability of exposure to gas | Mean level of exposure to gas | Period |
1 | 70 | 0.1 | 1945-1959 |
1 | 68 | 0.5 | 1960-1974 |
1 | 68 | 0.5 | 1975-1984 |
2 | 40 | 0.5 | 1945-1959 |
2 | 65 | 0.5 | 1960-1974 |
2 | 70 | 0.1 | 1975-1984 |
3 | 40 | 0.5 | 1945-1959 |
3 | 55 | 0.2 | 1960-1974 |
3 | 24 | 0.3 | 1975-1984 |
I want to merge data set 1 with data set 2 and then write a command that allow me to generate ever/never exposure to gas variable and life time cumulative exposure to gas variable.
Being ever exposed to gas is defined as having at least one occupation with a probability of exposure more than 50%. Individuals who worked only in a occupation with probability of exposure less than 50% to be considered unexposed.
For life time exposure it should be for each time period as the products of probability of exposure, mean level of exposure and duration of occupation in that specific time period. Then exposures over all time periods to be summed for each person.
many thanks for your help.
Comment