Adding reserve classes to extended_claims_data
add_classes.Rd
The columns Entry_reserve_class
and Exit_reserve_class
can now be derived from Ind_entry_cl_reserve
and Ind_cl_reserve
.
This function resembles only step 6 of the data preparation process, see description in details of prepare_data()
Arguments
- extended_claims_data
dataframe after step 5, see details of
prepare_data()
.- reserve_classes
numeric vector to specify reserve classes at the niveau of index_year, see details of
prepare_data()
.
Examples
# this example uses data provided with this package
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
new_data <- minimal_claims_data_xmpl %>%
reduce_data(indices_xmpl, 400000) %>%
add_missing_years(2023) %>%
add_columns() %>%
add_indexed_columns(indices_xmpl) %>%
filter_large_claims(400000, 1989, 3) %>%
add_classes(c(1, 200001, 400001, 700001, 1400001))
head(new_data)
#> Claim_id Origin_year Calendar_year Cl_payment_cal Cl_reserve An_payment_cal
#> 1 Claim#1 1976 1976 0 0 0
#> 2 Claim#1 1976 1977 0 0 0
#> 3 Claim#1 1976 1978 0 0 0
#> 4 Claim#1 1976 1979 0 0 0
#> 5 Claim#1 1976 1980 0 0 0
#> 6 Claim#1 1976 1981 0 0 0
#> An_reserve Development_year Payment_cal Reserve Cl_payment_cum An_payment_cum
#> 1 0 1 0 0 0 0
#> 2 0 2 0 0 0 0
#> 3 0 3 0 0 0 0
#> 4 0 4 0 0 0 0
#> 5 0 5 0 0 0 0
#> 6 0 6 0 0 0 0
#> Payment_cum Cl_incurred An_incurred Incurred Entry_cl_reserve
#> 1 0 0 0 0 0
#> 2 0 0 0 0 0
#> 3 0 0 0 0 0
#> 4 0 0 0 0 0
#> 5 0 0 0 0 0
#> 6 0 0 0 0 0
#> Entry_an_reserve Entry_reserve Ind_cl_payment_cal Ind_an_payment_cal
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_payment_cal Ind_cl_reserve Ind_an_reserve Ind_entry_cl_reserve
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_entry_an_reserve Ind_entry_reserve Ind_reserve Ind_cl_payment_cum
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_an_payment_cum Ind_payment_cum Ind_cl_incurred Ind_an_incurred
#> 1 0 0 0 0
#> 2 0 0 0 0
#> 3 0 0 0 0
#> 4 0 0 0 0
#> 5 0 0 0 0
#> 6 0 0 0 0
#> Ind_incurred Large_since Dev_year_of_growing_large Dev_year_since_large
#> 1 0 1978 3 -1
#> 2 0 1978 3 0
#> 3 0 1978 3 1
#> 4 0 1978 3 2
#> 5 0 1978 3 3
#> 6 0 1978 3 4
#> Entry_reserve_class Exit_reserve_class
#> 1 0 0
#> 2 0 0
#> 3 0 0
#> 4 0 0
#> 5 0 0
#> 6 0 0