# NOT RUN {
data(disabData)
## Model without bootstrap CI and no attribution
fit1 <- BinAddHaz(dis.bin ~ diab + arth + stro , data = disabData, weights = wgt,
attrib = FALSE)
summary(fit1)
## Model with bootstrap CI and attribution without stratification, no parallel calculation
# Warning message due to the low number of bootstrap replicates
# }
# NOT RUN {
fit2 <- BinAddHaz(dis.bin ~ diab + arth + stro , data = disabData, weights = wgt,
attrib = TRUE, collapse.background = FALSE, attrib.disease = FALSE,
type.attrib = "both", seed = 111, bootstrap = TRUE, conf.level = 0.95,
nbootstrap = 5)
summary(fit2)
## Model with bootstrap CI and attribution of diseases and background stratified by
## age, with parallel calculation of bootstrap CI
# Warning message due to the low number of bootstrap replicates
diseases <- as.matrix(disabData[,c("diab", "arth", "stro")])
fit3 <- BinAddHaz(dis.bin ~ factor(age) -1 + diseases:factor(age), data = disabData,
weights = wgt, attrib = TRUE, attrib.var = age,
collapse.background = FALSE, attrib.disease = TRUE, type.attrib = "both",
seed = 111, bootstrap = TRUE, conf.level = 0.95, nbootstrap = 10,
parallel = TRUE, type.parallel = "snow", ncpus = 4)
summary(fit3)
# }
Run the code above in your browser using DataCamp Workspace