Description Usage Arguments Examples
View source: R/agrupa_ordinal.R
group values of ordinal varibles according to a target variable .
1 2 | agrupa_ordinal(tbla_0, target_name, variable_name, grupos_iniciales,
limite)
|
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.