vardistr_perc: Variable distribution over time

Description Usage Arguments Details Value Functions Examples

Description

turns loan level data to monthly distributions

Usage

1
2
3
vardistr_amnt(data, var1, var2, weight, datedim, segmenter_level = 2, ...)

vardistr_perc(data, var1, var2, weight, datedim, segmenter_level = 2, ...)

Arguments

data

a monthly loan performance level data frame in standard data dictionary format

var1

the main (first) variable by which you wish to show the monthly distribution. Must be a "string". When segmenter_level = 2 then the levels of this variable are spread across the data frame. If segmenter_variable is = 3 then the unique levels of this variable are in the first column of the resultant data frame.

var2

Only used when segmenter_level = 3. The unique levels of this variable are then spread across the resultant data frame.

weight

either "NULL" or a weight variable such as "loan_amount" or "closingbalance". When "NULL" the weight is count of contracts. Note, must be entered as a "string".

datedim

the date field by which you wish to show the distribution. Usually "orig_month" or "fpd_month". "pointintime_month" is used when point in time distributions want to be done over time (book analysis). Must be entered as a "string".

segmenter_level

Default is = 2. Then only one level of segmentation (distribution over time) is done. If = 3 then two levels of segmentation are done, var1 being the main level and var 2 the sub-level.

...

parameters used in make_orig function.

Details

vardistr_perc

Value

a data frame with unique datedim in first column. other columns are the various levels of the var parameter. There is also a Total variable that contains the total of the weight parameter.

Functions

Examples

1
2
3
4
5
f_vdp_test <- vardistr_perc(data = df, var1 = "country", weight = "net_advance",
datedim = "pointintime_month", segmenter_level = 2, use_period = TRUE, period = fpd_period)

x <- vardistr_perc(data = df, var1 = "disclosure",
weight = "net_advance", datedim = "pointintime_month", segmenter_level = 2)

TheProfitTable/loanportr documentation built on May 28, 2019, 3:17 p.m.