Description Usage Arguments Details Value Author(s) See Also Examples
This function calculates age-standardized incidence and mortality rates for CPSII Mortality and Nutrition Cohorts analyses.
1 2 |
dat |
data.frame used in the analysis (default is "df" for use in modeling functions) |
agedist |
Age distribution standard (see nutweightlist documentation for details) |
agegrps |
Vector of start ages for the analysis. Default is 5-year age groups starting at age 40-44, 45-59,... 85+. To collapse ages, provide a vector of the ages you want each group to start with. For example, if you wanted to use 10-year age groups you would provide: c(40,50,60,70,80) to create age groups 40-49, 50-59, 60-69, 70-79, 80+. For 2 age groups (<65 and 65+) you would provide the vector c(40,65). |
dtint |
Variable name for the start of followup. Example: "dtint92", "dtint97", etc. |
birthday |
Variable name exact birthdate, typically "BDAYDATE" in our master file. |
failtime |
Variable name for fail time in days |
outcome |
Variable name for your outcome, formatted 0=control, 1=case |
expo |
Factor variable for your exposure. |
These rates are calculated using the pyrs() function in the survival package. Age-specific time and events are tabulated as each CPSII participant moves through calendar time. For example, if a participant enrolls in the study at age 49, they will contribute person time to the age 45-49 age group until their 50th birthday, and then start contributing person time to the 50-54 age group. Events are assessed at this attained age.
The pyrs() function simply calculated age- and strata-specific person years and events. The rest of the function calculates the age-adjustment and final rates.
The function returns a list of age-specific person-years and rates for each exposure level of your variable. Also includes:
Std.Rates |
Final age-standardized rates calculated for each exposure level |
Brian Carter
1 2 3 4 5 6 7 8 9 10 11 12 13 | df <- example.data
df$failtime <- as.numeric(df$dateft)-as.numeric(df$dtint92)
rates <- incrate(dat=df,
agedist="YEARS00",
agegrps=c(40,65),
dtint="dtint92",
birthday="bdaydate",
failtime="df$failtime",
outcome="dead",
expo="smoke92")
print(rates$Std.Rate)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.