Dear All, I used glm and then used step function for stepwise regression. Now, I want to store the variables used in the stepwise regression.
The code is the following. m_logistic <- glm(y ~ . + M1:T + M2:T + M3:T+ M4:T +M5:T, family=binomial("logit"), data = data) step_glm <- step(m_logistic) > step_glm$terms y ~ M1 + T + M1:T attr(,"variables") list(y, M1, T) attr(,"factors") M1 T M1:T y 0 0 0 M1 1 0 1 T 0 1 1 attr(,"term.labels") [1] "M1" "T" "M1:T" attr(,"order") [1] 1 1 2 attr(,"intercept") [1] 1 attr(,"response") [1] 1 attr(,".Environment") <environment: R_GlobalEnv> attr(,"predvars") list(y, M1, T) attr(,"dataClasses") y M1 T "numeric" "numeric" "numeric" How can I extract only "term.labels" ? Thank you, Soyeon ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.