Hi!

[LESS IMPORTANT INFORMATION HERE, YOU CAN SKIP IF YOU WANT]

My general problem is as follows:

- We used to vaccinate for TB from (say) 2000-2010, then stopped vaccinating
- We want to see if this was a bad decision (e.g. has TB infection risen since then?)
- A person is first infected with latent TB (LTBI) [unobservable in my data], which is then dormant for 1-40 years, and then activates into active TB infection [observable endpoint]

So I’ve been trying to gradually build up my models to answer this problem.

My first model:

No vaccination effect here. We get a sample of people in 2017, and can test to see if they have ever had LTBI or not. We then calculate the annual risk of LTBI. [This works]

My second model:

Vaccination stops after 10 years. We get a sample of people in 2017, and can test to see if they have ever had LTBI or not. We then calculate the annual risk of LTBI. [This works].

My third model:

No vaccination effect. People get directly infected with ATBI (no LTBI middle step), and we can directly count them in the year that they get infected. This requires survival analysis to estimate the annual risk of ATBI. [This works].

[IMPORTANT INFORMATION STARTS HERE]

My fourth model:

No vaccination effect. People get infected with LTBI, and then later on can get infected with ATBI (conditional upon having LTBI).

I said that time-to-LTBI was a geometric distribution, and time-to-ATBI (after getting LTBI) was a geometric distribution. I then modelled “observed ATBI cases” as “time-to-LTBI + time-to-ATBI”, and tried to do this by calculating the PDF and the survival function, and then putting it into stan. **The problem is that the estimated annual risk of LTBI and ATBI is not correct (doesn’t match with my simulated data) and I can’t figure out why. Any help with understanding why they don’t match would be greatly appreciated!**

A more detailed explanation, with all of the formulas and statistics is available here: http://rwhite.no/tb_vaccination/

The code, data, and results are available here: http://github.com/raubreywhite/tb_vaccination/

(“tb_vaccination.Rmd” is the important file)

Thanks for your time!