R: can I get regsubsets() to in-/exclude variables by groups?

别等时光非礼了梦想. 提交于 2021-01-27 19:17:17

问题


I'm working with a data frame containing a lot of indicator variables that I made from categorical variables using dummy(). When using regsubsets (from the leaps package), is there a way to make it include these indicators by group, not individually?

In other words, can I get it to test e.g. models that contain DF$Cat1.A, DF$Cat1.B, and DF$Cat1.C, but not models containing DF$Cat1.A without DF$Cat1.B or DF$Cat1.C?

来源:https://stackoverflow.com/questions/40267516/r-can-i-get-regsubsets-to-in-exclude-variables-by-groups

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!