csu_eapc | R Documentation |
csu_eapc
calculate the Estimated Annual Percentage Change (EAPC) of rates during a time period with the Confidence Interval (CI) across different population (Registry, year, sex...)
csu_eapc(df_data,
var_rate="asr",
var_year="year",
group_by=NULL,
var_eapc = "eapc",
CI_level = 0.95)
df_data |
Data (need to be R |
var_rate |
Rate variable. (Standardized or not, incidence, mortality, etc..) |
var_year |
Period variable. (Year, month, etc...) |
group_by |
A vector of variables to compare different EAPC (sex, country, cancer ...). |
var_eapc |
Name of the new variable for the EAPC. |
CI_level |
Confidence interval level. Default is 0.95. |
This function use Generalized Linear Model (GLM):
glm(log(rate) ~ year, family=gaussian(link = "identity")).
0 value are ignored. More details in reference below.
Return a dataframe.
Mathieu Laversanne
https://regstattools.iconcologia.net/stats/sart/eapc/eapc_method.pdf
csu_group_cases
csu_merge_cases_pop
csu_asr
csu_cumrisk
csu_ageSpecific
csu_ageSpecific_top
csu_bar_top
csu_time_trend
csu_trendCohortPeriod
data(csu_registry_data_2)
# you import your data from csv file using read.csv:
# mydata <- read.csv("mydata.csv", sep=",")
# Estimated Annual Percentage Change (EAPC) base on ASR.
df_asr <-
csu_asr(csu_registry_data_2,
"age", "cases", "py",
group_by = c("registry", "registry_label", "sex", "year", "ethnic" ),
var_age_group = c("registry_label"),
missing_age = 99
)
result <-
csu_eapc(df_asr,
"asr", "year",
group_by=c("registry", "registry_label", "sex", "ethnic" )
)
# you can export your result as csv file using write.csv:
# write.csv(result, file="result.csv")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.