| factor_analysis | R Documentation |
Performs a factor analysis for discrete risk factors in an insurance portfolio. The following summary statistics are calculated:
frequency = number of claims / exposure
average severity = severity / number of claims
risk premium = severity / exposure
loss ratio = severity / premium
average premium = premium / exposure
factor_analysis(
data = NULL,
risk_factors = NULL,
claim_amount = NULL,
claim_count = NULL,
exposure = NULL,
premium = NULL,
group_by = NULL,
df = NULL,
x = NULL,
severity = NULL,
nclaims = NULL,
by = NULL
)
data |
A |
risk_factors |
Character vector: column(s) in |
claim_amount |
Character, column in |
claim_count |
Character, column in |
exposure |
Character, column in |
premium |
Character, column in |
group_by |
Character vector of column(s) in |
df, x, severity, nclaims, by |
Deprecated argument names. Use |
The function computes summary statistics for discrete risk factors.
Frequency: number of claims / exposure
Average severity: severity / number of claims
Risk premium: severity / exposure
Loss ratio: severity / premium
Average premium: premium / exposure
If one or more input arguments are not specified, the related statistics are omitted from the results.
univariate()The function univariate() is deprecated as of version 0.8.0 and replaced by
factor_analysis(). In addition to the name change, the interface has also
changed:
univariate() used non-standard evaluation (NSE), so column names could be
passed unquoted (e.g. x = area).
factor_analysis() uses standard evaluation (SE), so column names must
be passed as character strings (e.g. x = "area").
This makes the function easier to use in programmatic workflows.
univariate() is still available for backward compatibility but will emit a
deprecation warning and will be removed in a future release.
An object of class "factor_analysis" and "univariate" with
summary statistics.
Martin Haringa
## --- New usage (SE) ---
factor_analysis(MTPL2,
risk_factors = "area",
claim_amount = "amount",
claim_count = "nclaims",
exposure = "exposure",
premium = "premium")
## --- Deprecated usage (NSE) ---
univariate(MTPL2,
x = area,
severity = amount,
nclaims = nclaims,
exposure = exposure,
premium = premium)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.