Description Usage Arguments Examples
View source: R/redefine_level_0.R
redefine level 0 for a list of factors variables .
1 | redefine_level_0(df_agrupada_y, variables, nombre_target)
|
df_agrupada_y |
table with data. It has to have the nominal variable and the target variable. |
variables |
names of the factor variables. |
nombre_target |
name of the target variable. |
1 2 3 4 5 6 7 8 9 | x1 = rnorm(1000)
x2 = rnorm(1000)
x3= ifelse(as.factor(x2>0.5)==T, 'A', 'B')
x4= ifelse(as.factor(x2>0.7)==T, 'C', 'D')
z = 1 + 2 * x1 + 3 * x2+2*x4
pr = 1/(1+exp(-z))
y = rbinom(1000,1,pr)
tbla = data.frame(y=y,x1=x1,x2=x2, x3=x3, x4=x4)
tbla<-redefine_level_0( df_agrupada_y=tbla ,variables=c('x3', 'x4') ,nombre_target='y')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.