claims_at: Claims At

Description Usage Arguments Details Examples

Description

Given a data.table of claimvaluations (i.e. with columns "ValuationDate", "ClaimID", ...), return claim-level subsets of the data.

Usage

1
2
3
claims_at(claimvaluations, valuationDate = NULL, claimAge = NULL,
  policyAge = NULL, maxValuationDate = NULL,
  dropImmatureValuations = TRUE, colmap_claimvaluations = NULL)

Arguments

claimvaluations

data.table object with columns "ValuationDate", "ClaimID". Depending on the exact call to claims_at(...), other columns may be required.

valuationDate

return all claims valued as of this date

claimAge

return all claims as of this age, as measured in months since DateOfLoss

policyAge

return all claims valued at the time their policy is this age, as measured in months since Effective Date

maxValuationDate

don't return claims valued after this date

dropImmatureValuations

should claims be excluded in the result if their first valuation date is before maxValuationDate?

colmap_claimvaluations

named vector of column mapping

Details

One may return

claims valued as of a specific date

E.g. "claims valued as of 2016-12-31"

claims valued as of a specific claim age

E.g. "claims valued as of age = 9 months"

claims valued as of a specific policy age

E.g. "claims at the instant their policy is of age = 12 months"

Here, "claim age" refers to the number of months since the date of loss (DateOfLoss) while "policy age" refers to the number of months since the effective date. Additionally, the parameter maxValuationDate may be provided to prevent results which have future valuation dates. For example, if claimvaluations has monthly valuations from Jan 2010 thru Dec 2016, specifying maxValuationDate = as.Date("2016-12-31") and calling claims_at(claimvaluationz, claimAge = 2) will discard all claims which occured in Novemeber and December of 2016.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
library(lubridate)
library(data.table)

# Sample claim valuations
claimvaluationz

# View claims as they were valued on 2015-06-30
claims_at(claimvaluationz, valuationDate = as.Date("2015-06-30"))

# View each claim at age = 12 months
claims_at(claimvaluationz, claimAge = 12)

# View each claim at age = 12 months, assuming the data is valued as of 2016-03-01
claims_at(claimvaluationz, claimAge = 12, maxValuationDate = as.Date("2016-03-01"))

# View claims as they were valued when each policy was age = 12 months
claims_at(claimvaluationz, policyAge = 12)

ben519/claimz documentation built on May 12, 2019, 10:56 a.m.