agrupa_ordinal: agrupa_ordinal

Description Usage Arguments Examples

View source: R/agrupa_ordinal.R

Description

group values of ordinal varibles according to a target variable .

Usage

1
2
agrupa_ordinal(tbla_0, target_name, variable_name, grupos_iniciales,
  limite)

Arguments

variable_name

name of the ordinal variable that you want to group.

grupos_iniciales

number of quantiles that you want to create. Uses quantile function.

limite

probability of not belonging to the same group. Used for the hypergeometric test.

tbla

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

target-name

name if the target variable.

Examples

1
2
3
4
5
set.seed(1)
valor_variable1=round(runif(100)*10,0)
target_variable1=as.numeric((valor_variable1/10+runif(100)*0.25) >0.525)
tbla<-data.frame(variable1=valor_variable1, target_n= target_variable1)
agrupa_ordinal(tbla,  'target_n','variable1', 10, 0.8)

GabyP/preparation4modeling documentation built on Sept. 24, 2020, 11:57 p.m.