assign_gid: clusters explanatory variables of high absolute correlation

Description Usage Arguments Value Author(s) Examples

View source: R/contselec-package8.R

Description

This function clusters explanatory variables of high absolute correlation and assign group ids for them.

Usage

1
assign_gid(data0, edge_cor)

Arguments

data0

data.frame : explained variable (1st column), and explanatory variables (2nd-last columns) to be contracted

edge_cor

real number : threshold for grouping; variables of correlation no less than this threshold are grouped together

Value

gid : array of integer : group-ids for explanatory variables in "data0"

Author(s)

Hiroshi C. Ito

Examples

1
2
3
4
5
data(Cars93, package = "MASS");
data=Cars93;
data=data[complete.cases(data),];
data=data[,sapply(data[1,],is.numeric)];
assign_gid(data,edge_cor=0.9);

yorickuser/contselec documentation built on July 25, 2021, 8:14 a.m.