Skip to content
Prev 274866 / 398506 Next

Subsetting data by eliminating redundant variables

Assuming you are talking about redun() from the Hmisc package, it's
much easier than you are making it:

n <- 100
x1 <- runif(n)
x2 <- runif(n)
x3 <- x1 + x2 + runif(n)/10
x4 <- x1 + x2 + x3 + runif(n)/10
x5 <- factor(sample(c('a','b','c'),n,replace=TRUE))
x6 <- 1*(x5=='a' | x5=='c')
data1 <- data.frame(x1,x2,x3,x4,x5,x6)

library(Hmisc)

V <- redun(~., data = data1, r2 = 0.8)

V$In

V$Out

Michael
On Wed, Oct 19, 2011 at 6:49 AM, aajit75 <aajit75 at yahoo.co.in> wrote: