View source: R/CompleteDFLEtable.R
CompleteDFLEtable | R Documentation |
From an input dataset containing some information on age, mortality rates and prevalences of disability (at least 'age', 'qx' or 'mx', and 'pix' must be within the input dataset), the function completes it with values of life expectancies and disability-free life expectancies. If some indispensable variables are missing (eg 'age'), the output is the same as the input dataset. If the input dataset contains mortality rates ('qx') but no prevalence of disabilities ('pix'), only total life-expectancy is calculed.
CompleteDFLEtable(tab, categories = c(""))
tab |
a dataframe containing some of the variables |
categories |
a vector of names of variables of the 'tab' dataframe, representing categories (optional) |
Full headings for the names of variables in the output dataset can be found in the 'description_sullivan' dataframe (in the package).
If variables 'sex' and/or 'year' and/or 'categ' (an undefinite category variable that can be defined by the user) are in the input dataset, calculations are performed for each separate values of 'sex', 'year' and/or 'categ'. If 'categories' is provided (a vector of variable names in 'tab'), a 'categ' variable is created in a first step from all the variables in 'categories'.
Calculations follow example 1 in the sullivan manual (June 2007 version). See https://reves.site.ined.fr/en/resources/computation_online/sullivan/ for more explanations.
a dataframe with all variables that can be calculated from the input dataframe
CompleteDFLEtable( sullivan[,c("year","age","mx","qx","pix")] )
CompleteDFLEtable( FRInseeMortalityForecast2016[FRInseeMortalityForecast2016$year %in% c(2013,2015,2020,2030),] )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.