demog_pyears | R Documentation |
This is a wrapper for the pyears
function
in the survival
package with convenient stratifications for
demographic analyses.
demog_pyears( formula, data, period = NULL, agegr = NULL, cohort = NULL, tips = NULL, origin = 1900, scale = 12, dob = "(dob)", intv = "(intv)", tstart = "tstart", tstop = "tstop", event = "event", weights = NULL )
formula |
a formula object.
The response variable will be a vector of follow-up times
for each subject, or a |
data |
a data frame in which to interpret the variables named in
the |
period |
Numeric vector defining calendar periods to stratify analysis, use |
agegr |
Numeric vector defining ages in years for splits. |
cohort |
Numeric vector defining birth cohorts to stratify analysis, use |
tips |
Break points for TIme Preceding Survey. |
origin |
Origin year for date arguments. 1900 for CMC inputs. |
scale |
a scaling for the results. As most rate tables are in units/day, the default value of 365.25 causes the output to be reported in years. |
dob |
Variable name for date of birth (character string). |
intv |
Variable name for interview date (character string). |
tstart |
Variable name for the start of follow up time, example is date of birth. Default is 'tstart'. |
tstop |
Variable name for the end of follow up time, examples include interview date or date of death. Default is 'tend'. |
event |
Variable name for the event indicator, example is birth or death. Default is 'event'. |
weights |
case weights. |
Note that event
must be a binary variable per the internals
of the pyears()
function. The function could
be updated to work around this stipulation.
pyears
, tcut
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.