Description Usage Arguments Examples
ventiles
1 | ventiles(tbla, targets, score_name, partition = 0.05)
|
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 |
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.