Re: [R] variable selection using residual difference

2016-03-19 Thread Bert Gunter
Suggestion: Don't do this! I suggest that you consult with a local statistician or post to a statistical website like stats.stackexchange.com for what might be sensible procedures for variable selection (a complex and controversial topic!) and why what you propose is or is not a good idea (don't

[R] variable selection using residual difference

2016-03-19 Thread Hassan, Nazatulshima
I have the following example dataset set.seed(2001) n <- 100 Y <- c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) X1 <- sample(x=c(0,1,2), size