From 987b7ccf99612a8f02a222745e96f957d6f8fc13 Mon Sep 17 00:00:00 2001 From: Duncan Gillespie Date: Thu, 26 Oct 2023 14:02:41 +0100 Subject: [PATCH] review PAF calculations --- R/PAFcalc.R | 8 ++++++-- R/subgroupRisk.R | 2 +- man/PAFcalc.Rd | 6 +++++- man/subgroupRisk.Rd | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/R/PAFcalc.R b/R/PAFcalc.R index 05f24ad..be899ac 100644 --- a/R/PAFcalc.R +++ b/R/PAFcalc.R @@ -33,6 +33,8 @@ #' that are not categorised as CVD, COPD, or Cancer. Options: c("Cancers", "CVD", "COPD", "immediate"). #' The default is "Cancers", which gives the most conservative (i.e. slowest) estimate of the rate of decline in #' the risk of disease after quitting smoking. +#' @param oesoph_subtypes Logical - should the attributable fractions for oesophageal cancer +#' be multiplied by the proportions of each subtype. Defaults to FALSE. #' #' @return Returns a data.table containing the estimated PAFs. #' @@ -72,7 +74,8 @@ PAFcalc <- function( within_model = FALSE, mort_or_morb = c("mort", "morb")[1], country = c("England", "Scotland")[1], - other_lag_function = "Cancers" + other_lag_function = "Cancers", + oesoph_subtypes = FALSE ) { @@ -163,7 +166,8 @@ PAFcalc <- function( disease_names = disease_names, use_weights = use_weights, pool = pool, - subgroups = subgroups) + subgroups = subgroups, + oesoph_subtypes = oesoph_subtypes) return(paf_data) diff --git a/R/subgroupRisk.R b/R/subgroupRisk.R index 8b45101..02cab1e 100644 --- a/R/subgroupRisk.R +++ b/R/subgroupRisk.R @@ -28,7 +28,7 @@ #' @param smooth Logical - should the age patterns in average risk be smoothed with a moving average. #' For use only if average risk is stratified by single years of age. Defaults to FALSE #' @param oesoph_subtypes Logical - should the attributable fractions for oesophageal cancer -#' be multiplied by the proportions of each subtype. In development. Defaults to FALSE. +#' be multiplied by the proportions of each subtype. Defaults to FALSE. #' #' @return Returns a data table containing the subgroup specific summaries for each disease. #' diff --git a/man/PAFcalc.Rd b/man/PAFcalc.Rd index e4b011c..706a1a4 100644 --- a/man/PAFcalc.Rd +++ b/man/PAFcalc.Rd @@ -21,7 +21,8 @@ PAFcalc( within_model = FALSE, mort_or_morb = c("mort", "morb")[1], country = c("England", "Scotland")[1], - other_lag_function = "Cancers" + other_lag_function = "Cancers", + oesoph_subtypes = FALSE ) } \arguments{ @@ -79,6 +80,9 @@ should refer to mortality or morbidity. Values could be "mort" or "morb". Defaul that are not categorised as CVD, COPD, or Cancer. Options: c("Cancers", "CVD", "COPD", "immediate"). The default is "Cancers", which gives the most conservative (i.e. slowest) estimate of the rate of decline in the risk of disease after quitting smoking.} + +\item{oesoph_subtypes}{Logical - should the attributable fractions for oesophageal cancer +be multiplied by the proportions of each subtype. Defaults to FALSE.} } \value{ Returns a data.table containing the estimated PAFs. diff --git a/man/subgroupRisk.Rd b/man/subgroupRisk.Rd index 41cf3b8..d9ab8f9 100644 --- a/man/subgroupRisk.Rd +++ b/man/subgroupRisk.Rd @@ -55,7 +55,7 @@ just tobacco ("tob") or joint risks for tobacco and alcohol ("tobalc").} For use only if average risk is stratified by single years of age. Defaults to FALSE} \item{oesoph_subtypes}{Logical - should the attributable fractions for oesophageal cancer -be multiplied by the proportions of each subtype. In development. Defaults to FALSE.} +be multiplied by the proportions of each subtype. Defaults to FALSE.} } \value{ Returns a data table containing the subgroup specific summaries for each disease.