Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It only takes a minute to sign up.
I am looking for a variable selection technique in R to reduce the number of my regression predictors, where I can force the method to keep a specific variable within the model. Here is a toy example from the R help of ?step, the variable "Examination" will be removed:
$\begingroup$Note that typical variable selection strategies (such as stepwise selection algorithms), which I suspect you have in mind based on the reference to step(), are not valid. If that doesn't make sense / you want to know why, you may want to read my answer here: algorithms-for-automatic-model-selection.$\endgroup$
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
scope
option (and there is enough information on this pre-selection in?step
). $\endgroup$step()
, are not valid. If that doesn't make sense / you want to know why, you may want to read my answer here: algorithms-for-automatic-model-selection. $\endgroup$