Learn R Programming

insurancerating (version 0.6.3)

univariate: 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 df with risk factor

severity

column in df with severity (default is NULL)

nclaims

column in df with number of claims (default is NULL)

exposure

column in df with exposure (default is NULL)

premium

column in df with premium (default is NULL)

by

column(s) in df to group by

Value

A list of class univ_all with components

df

data frame

xvar

name of column in df with risk factor

severity

name of column in df with severity

nclaims

name of column in df with number of claims

exposure

name of column in df with exposure

premium

name of column in df with premium

Examples

Run this code
# NOT RUN {
univariate(MTPL2, x = area, severity = amount, nclaims = nclaims,
           exposure = exposure, premium = premium)

# The summary statistics related to premium are not calculated
univariate(MTPL2, x = area, severity = amount, nclaims = nclaims, exposure = exposure)

# }

Run the code above in your browser using DataLab