Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a vignette for life_table() and burden_le() #5

Open
ivanhanigan opened this issue Jul 31, 2019 · 0 comments
Open

Add a vignette for life_table() and burden_le() #5

ivanhanigan opened this issue Jul 31, 2019 · 0 comments

Comments

@ivanhanigan
Copy link
Contributor

Something like this. I have been working on a demo.
I can plan to add this in the next few weeks.

## Set up scenario: use HRAPIE recommended CRF 
rr_use <- data.frame(est_type = c("RRper10", "RRper10_lci", "RRper10_uci"),
                     est = c(1.062, 1.040, 1.083))
rr_use
## estimate for change in exposure of
deltaX = 3

## Create demog data
demog_data = data.frame(age = dat$start_age,
                            population = dat$pop,
                            deaths = dat$death)
demog_data

## Calculate for RR and 95CIs
for(est_type in rr_use$est_type){
    ##
    rr <- rr_use[rr_use$est_type == est_type, "est"]
    print(est_type)
    
## Calculate life table
le = burden_le(demog_data,
               pm_concentration = deltaX,
               RR = rr)
## le

## Calculate yll from lifetable
impacted_le <- le[["impacted"]][, "ex"]
## impacted_le

an <- burden_an(demog_data,
                pm_concentration = deltaX,
                RR = rr)
yll <- burden_yll(an, impacted_le)
@ivanhanigan ivanhanigan changed the title Add a vignette for life_table and burden_le Add a vignette for life_table() and burden_le() Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant