Actuariat Vie

Master MBFA Le Mans

Notations actuarielles

Notations (Latex Life Contingencies’ Symbols)

International Actuarial Notations

Tables de mortalité 

Premiers calculs actuariels

Exemples sur SAS & R

IRISH tables of Mortality from CSO

Ce code permet de créer un fichier SAS avec les tables de mortalité importées depuis le CSO

****************************************************;

* Irish Central Statistics Office using the csodata package in R, which allows us to access the CSO s PxStat Open Data Platform.

https://data.cso.ie/ ;

****************************************************;

proc iml;

submit /r;

install.packages("csodata")

library(csodata)

I1 <- cso_get_data("VSA32",pivot_format="tidy")

endsubmit;

call ImportDataSetFromR("I1", "I1" );

quit;



data I2;

informat x 3.;

set I1;

x=scan(age_x, 1);

if x<0 then x=0;

run;

proc sort data=I2;

by year sex ;

run;



FILENAME IRISH clear;

FILENAME IRISH '0_IRISH.sas';

DATA _NULL_ ;

SET I2 end=eof;

by year sex;

FILE IRISH;

*If _n_=1 then do;

if 'first.sex'n then do;

a=compress(year||sex);

PUT 'data IRISH_csodata_' a ' (LABEL="csodata VSA32 https://data.cso.ie/ year ' a '");';

PUT "INPUT x: Lx qx;";

PUT "DATALINES;" ;

end;

PUT x Ix qx;

IF 'last.sex'n then put ";;;;run;";

RUN;