Hi,

I have yet another question about survival analysis, this time regarding the appropriate code using STATA. I am trying to account for left-truncated data.

This is the data after snapspan:
(snapspan idd date1 year age event, gen(date0))


Data

id.......date0....date1......year.... ..event.. ..Y.......Z....... ..age......entrydate.....exit

1...........-........1776.......1950.........0.......1.......9998.......174.......1776........1954
1........1776......1950.......1951.........0.......0.......9993.......175.......1776........1954
1........1950......1951.......1952.........0.......0.......9113.......176.......1776........1954
1........1951......1952.......1953.........0.......1.......9962.......177.......1776........1954
1........1952......1953.......1954.........1.......1.......9996.......178.......1776........1954

2..........-..........1950.......1950........0.......1........3332.......1.........1950.......1954
2........1950.......1951.......1951........0.......1........3321.......2.........1950......1954
2........1951.......1952.......1952........0.......1........2446.......3.........1950......1954
2........1952.......1953.......1953........0.......1........5422.......4.........1950......1954
2........1953.......1954........1954.......1.......1........3546.......5.........1950......1954


Because my data sometimes contains tens of observations per subject (due to yearly records of time-varying covariates) I have trouble following epidemological textbooks examples.

I'm assuming that if I didn't care for left-truncation, I could use:

stset howold, failure(event==1) id(id)

But if I do want to account for truncation, then I would use the age of the subject as the timescale and input:

stset date1, failure(event==1) id(id) origin(date0)



Is that enough to 'account' for left-truncation? It seems a little too easy. can I proceeed estimating cumulative hazard functions, or do I have to take some additional steps?

I would be very grateful for any help - I'm doing a PhD on this, and neither of my supervisors deal with survival analysis. I want to make sure I do things the right way.

Best,

Basia