Re: [R] Get Index of variables from stepAIC

2013-08-26 Thread Adams, Jean
Here's one way to do it ... # create example data frame y <- rnorm(30) gene_subset <- data.frame(y, x1=rnorm(30), x2=rnorm(30), x3=100*y+rnorm(30)) # fit a full linear model fit <- lm(y ~ ., df) # reduce the model reduced_model <- stepAIC(fit, trace=FALSE) # NON-omitted variables (excluding the

[R] Get Index of variables from stepAIC

2013-08-25 Thread Sachinthaka Abeywardana
I am regressing a gene on another gene subset. Then I use stepAIC to reduce the number of explanatory genes. How do I get the index of the NON-omitted variables, so that I could analyse them? gene_subset=c(y=genes[,i], genes[,other_genes]); reduced_model=stepAIC(y~.,data=gene_subset,trace=