library("iCare") data("bc_data", package="iCare") ### Example 1.A: # Fitting a SNP-only model, with no specific genotypes supplied for estimation # Population disease rates from SEER res_snps_miss = compute.absolute.risk(model.snp.info = bc_15_snps, model.disease.incidence.rates = bc_inc, model.competing.incidence.rates = mort_inc, apply.age.start = 50, apply.age.interval.length = 30, return.refs.risk = T) # requesting that referent dataset risks be included in results # Visualizing the Results summary(res_snps_miss$risk) summary(res_snps_miss$refs.risk) plot(density(res_snps_miss$risk), lwd=2, main="SNP-only Risk Stratification: Ages 50-80", xlab="Absolute Risk of Breast Cancer") ### Example 1.B # Estimating risk in ages 50-80 # Fitting a SNP-only model, with three specific genotypes supplied for estimation (with some missing data) res_snps_dat = compute.absolute.risk(model.snp.info = bc_15_snps, model.disease.incidence.rates = bc_inc, model.competing.incidence.rates = mort_inc, apply.age.start = 50, apply.age.interval.length = 30, apply.snp.profile = new_snp_prof, return.refs.risk = T) # requesting that referent dataset risks be included in results # Visualizing the Results names(res_snps_dat) plot(density(res_snps_dat$refs.risk), lwd=2, main="Referent SNP-only Risk Distribution: Ages 50-80", xlab="Absolute Risk of Breast Cancer") abline(v=res_snps_dat$risk, col="red") legend("topright", legend="New Profiles", col="red", lwd=1) ### Example 2 # example of creating the model.cov.info input in the proper format v1=list() v1$name = "famhist" v1$type = "continuous" v2 = list() v2$name = "parity" v2$type = "factor" v2$levels = c(0,1,2,3,4) v2$ref = 0 bc_model_cov_info <- list(v1, v2) # Estimating risk in ages 50-80 # Fitting a model with two risk factors and 15 SNPs, with # three specific covariate profiles supplied for estimation (with some missing data) res_covs_snps = compute.absolute.risk(model.formula = caco ~ famhist + as.factor(parity), model.cov.info = bc_model_cov_info, model.snp.info = bc_15_snps, model.log.RR = bc_model_log_or, model.ref.dataset = ref_cov_dat, model.disease.incidence.rates = bc_inc, model.competing.incidence.rates = mort_inc, model.bin.fh.name = "famhist", apply.age.start = 50, apply.age.interval.length = 30, apply.cov.profile = new_cov_prof, apply.snp.profile = new_snp_prof, return.refs.risk = T) # Viewing detailed output print(res_covs_snps$details)