ventiles: ventiles

Description Usage Arguments Examples

View source: R/ventiles.R

Description

ventiles

Usage

1
ventiles(tbla, targets, score_name, partition = 0.05)

Arguments

tbla

table with data. It has to have the variable and the target variables.

targets

vector with the names of the targets.

score_name

name of the score variable.

partition

of group: quantile 0 to 1 by partition

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x1 = rnorm(1000)
x2 = rnorm(1000)
z = 1 + 2 * x1 + 3 * x2
pr = 1/(1+exp(-z))
y = rbinom(1000,1,pr)
y1 = rbinom(1000,1,abs(pr-0.05))
tbla = data.frame(y=y,x1=x1,x2=x2, y1=y1)
f=formula(y~x1+x2)
lr <- glm(f, tbla, family = 'binomial')
tbla$prob<-predict(lr, tbla, type='response')
ventiles(tbla, targets=c('y', 'y1'), score_name = 'prob')

GabyP/categorizaOrdinales documentation built on Sept. 21, 2020, 1:42 p.m.