factor.penal.info.to.output: Measuring relative information between factors and output...

Description Usage Arguments Value Examples

Description

Measuring relative information between factors and output variable

Usage

1
2
factor.penal.info.to.output(data, var.output, vars.list, alpha = 2,
  return.list = FALSE)

Arguments

data

A data frame

var.output

The name of the variable output

vars.list

(optional) A list of pairs (variable.name,variable.type) such as those produced by allvariables.manual.review

alpha

(defaults to 2) The penalty

return.list

(defaults to TRUE) If TRUE, the function returns a list of one-line dataframes; if FALSE, it returns a concatenated dataframe sorted by decreasing value of RI.to.output

Value

A data frame with three columns: variable names, the number of active levels, and their penalized relative information to the output variable

Examples

1
2
3
4
5
6
X <- data.frame(a = factor(sample(1:3,100,TRUE)),
                b = factor(sample(1:5,100,TRUE)),
                c = factor(sample(letters[1:5],100,TRUE)))
factor.penal.info.to.output(X, "a", alpha = 2)
list_ <- list(c("vs","factor"),c("am","factor"),c("gear","factor"))
factor.penal.info.to.output(mtcars, "cyl", vars.list = list_, alpha = 1.5, return.list = TRUE)

ahdxb/data.exploration documentation built on May 11, 2019, 11:31 p.m.