univariate {insurancerating} | R Documentation |
Univariate analysis for discrete risk factors
Description
Univariate analysis for discrete risk factors in an insurance portfolio. The following summary statistics are calculated:
frequency (i.e. number of claims / exposure)
average severity (i.e. severity / number of claims)
risk premium (i.e. severity / exposure)
loss ratio (i.e. severity / premium)
average premium (i.e. premium / exposure)
If input arguments are not specified, the summary statistics related to these arguments are ignored.
Usage
univariate(
df,
x,
severity = NULL,
nclaims = NULL,
exposure = NULL,
premium = NULL,
by = NULL
)
Arguments
df |
data.frame with insurance portfolio |
x |
column in |
severity |
column in |
nclaims |
column in |
exposure |
column in |
premium |
column in |
by |
list of column(s) in |
Value
A data.frame
Author(s)
Martin Haringa
Examples
# Summarize by `area`
univariate(MTPL2, x = area, severity = amount, nclaims = nclaims,
exposure = exposure, premium = premium)
# Summarize by `area`, with column name in external vector
xt <- "area"
univariate(MTPL2, x = vec_ext(xt), severity = amount, nclaims = nclaims,
exposure = exposure, premium = premium)
# Summarize by `zip` and `bm`
univariate(MTPL, x = zip, severity = amount, nclaims = nclaims,
exposure = exposure, by = bm)
# Summarize by `zip`, `bm` and `power`
univariate(MTPL, x = zip, severity = amount, nclaims = nclaims,
exposure = exposure, by = list(bm, power))