[R-sig-ins] General Insurance Data

Christophe Dutang dutangc at gmail.com
Sat Sep 27 15:08:12 CEST 2014


Dear Edward,

To my knowledge, there is no single package doing data manipulation in the insurance context.

There are package for manipulating from database manager and other proprietary softwares : see http://cran.r-project.org/doc/manuals/r-release/R-data.html

Maintaining the CASdatasets package, I face to some of your problem to read SAS or excel files. Typically the case, where there is a separator for thousand. I did write some R functions :
- readfunc(filelist, yearlist, sheetname, pattern, nrow, ncol, colname, col2conv, echo=FALSE, row2rm=NULL) : read a list of excel file to extract the same sheet and concatenate the whole
- str2num(x) : convert a character string to a numeric dealing with thousand separator
- concatmultcol(df, nbinfo, nbblock, col2foot, col2conv, col2rmpre, cm2rmpost, cname2trunc=NULL, echo=FALSE) : concatenate blockwise data into a rowwise dataframe
etc...
In such function, I read excel files with gdata package.

As you say, for manipulating triangles, there are functions in ChainLadder. By the way, I propose cum2incr and incr2cum to M. Gesmann. Another function shrinkTriangle was not kept in this package: this function computes an annual triangle from a monthly or quarterly basis.

For manipulating string, there is a good book by Gaston Sanchez, see http://gastonsanchez.com/work/

At the last R in insurance conf, there was a good presentation of data manipulation (see http://www.cass.city.ac.uk/news-and-events/conferences/r-in-insurance-2014/r-in-insurance,-conference-programme and ask for presentation file).

Do you have a detailed list of what type of data you want to manipulate? for which purpose? (is it only for reserving purpose?)
If you are willing to create a package, I will be happy to contribute. 

Regards, Christophe
—
Christophe Dutang
LMM, UdM, Le Mans, France
web: http://dutangc.free.fr

Le 27 sept. 2014 à 01:16, Edward Roche <ed.roche at yahoo.co.uk> a écrit :

> Hi all,
> I am interested in a package for working with General Insurance data, i.e. something that deals with the initial stage of getting GI data into R, reshaping it and subsetting it before performing projections using packages such as ChainLadder or claim development visualisations using googlevis.
> 
> When working with GI data before you can do any meaningful analysis or projections you need to get your data in the right format. Typically you might start with incremental long format data showing claim transactions and this needs to be reshaped and summarised into triangle matrices (e.g.  paid and incurreds). You can then perform projections with packages such as ChainLadder or other simple development methods. This initial manipulation stage is not always easy to do especially for novice users of R. There are helper functions in the ChainLadder package such as incr2cum, as.triangle etc that let you perform conversions on the fly but I cant find anything for the wholesale restructuring or manipulation of GI data such as converting it from Annual Quarterly to Annual Annual etc. This type of manipulation is very easy to do in some proprietary software (not R based) that I use on a daily basis.
> I am considering working on a package that would generally provide helper functions to load untidy GI data into R and let a novice R user perform restructuring and manipulation on the fly.  I envisage a GUI such as is available in Rattle to load the data and specify the key variables and formats. Once the data is loaded intuitive helper functions would let you manipulate it on the fly. For example you might wish to pick out paid and incurred triangles, subset the data in some way or convert it to Annual Annual or from cumulative to incremental.
> 
> My question for this mailing list is are there any such packages out there? or is anyone working on something like this? I would love to get involved if so. Any other thoughts?
> 
> Thanks
> Ed
> 
> _______________________________________________
> R-SIG-insurance mailing list
> R-SIG-insurance at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-insurance



More information about the R-SIG-insurance mailing list