loss_df: loss_df S3 class constructor

Description Usage Arguments Details Examples

View source: R/loss_df.R

Description

loss_df is the primary S3 data class for the lossdb package. A loss_df is a data frame for insurance loss data. Each row/observation represents losses at a unique "origin", "dev", and optional "id" (i.e loss_df takes loss data organized by claim/occurrence "id", "origin", and "dev" or just by "origin" and "dev"). Each column contains certain variables of interest to the actuarial analysis.

Usage

1
2
loss_df(ldf, origin, dev, id = NULL, paid = NULL, incurred = NULL,
  paid_recovery = NULL, incurred_recovery = NULL, desc = NULL)

Arguments

ldf

a data frame containing columns to be passed to loss_df

origin

policy period in which the claim/loss is associated

dev

development stage of claim/loss

id

optional identification key for loss (e.g. a claim number)

paid

vector listing names for all paid loss columns

incurred

vector listing names for all incurred loss columns

paid_recovery

vector listing names for all paid recovery columns

incurred_recovery

vector listing names for all incurred recovery columns

desc

vector of all additional columns relevant to the analysis. Common examples are "open claims", and "reported claims" (when claims are evaluated on an occurrence basis)

Details

loss_df is designed to assign descriptive and consistent names to loss data to allow for quick execution of common actuarial analysis tasks.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# create loss_df object from `occurences` dataset
mydf <- loss_df(occurrences,  id = "claim_number",
                              origin = "origin",
                              dev = "dev",
                              paid = c("paid_loss_only", "paid_expense"),
                              incurred = c("incurred_loss_only", "incurred_expense"),
                              paid_recovery = c("sal_sub", "paid_excess250"),
                              incurred_recovery = c("incurred_excess250", "sal_sub_incurred"),
                              desc = "claim_cts"
                 )

merlinoa/lossdb documentation built on May 22, 2017, 4:15 a.m.