vars_stability: vars_stability

Description Usage Arguments Examples

Description

get Komolgorov-Smirnov value test for a variable for a list of periods/or other variable. .

Usage

1
vars_stability(tbla, formula_model, target_name, splitter_name)

Arguments

tbla

table with data. It has to have the target_name.

formula_model

the model with the list of variables.

target_name

the name of the target.

splitter_name

the name of the variable that is going to be used to split the data.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
set.seed(1)
x1 = rnorm(1000)
x2 = rnorm(1000)
x4='A'
x4=ifelse(x1>0.1,'B', x4)
x4=ifelse(x1>0.4,'C', x4 )
x4=ifelse(x1>0.6,'D', x4 )
x4=ifelse(x1>0.8,'E', x4 )
per=c(rep(201810,200),rep(201812,400),rep(201901,400))
z = 1 + 3*x1 + x2
pr = 1/(1+exp(-z))
y = rbinom(1000,1,pr)
tbla = data.frame(y=y,x1=x1,x2=x2, x4=x4, per=per)
formula_model=formula(y~x2+x1+x4)
aa=vars_stability(tbla, formula_model,'y', 'per')
aa[1]
aa[2]
aa[3]
aa[4]

GabyP/evaluaModelo documentation built on June 9, 2019, 4:52 a.m.