hashlage1-4 is the last age they smoked at for a given time period. hashlage1-4 is the first age. hashtot is indicating the number of smoking episodes they had. In the code that I pasted in, I'm just creating a duration variable, so last age - first age (plus 1 so I didn't have anyone with a '0' in case they started and stopped within the same year), then adding together that number (the number of years smoked) for each time period that they were smokers (say if they smoked from 18 to 24, then stopped, then started again from 30-37, they would have two time periods). What I want to do is limit my analysis to only the data before they were 35 years old. So, using the example I just gave, I want to exclude the two years after age 35, and only include their data from age 18 to age 35 (even though they continued to smoke after age 35). My outcome is related to early life exposure, which is why I'm trying to do this, and the exposure is smoking. Let me know if you need some more information. Thanks!
... View more