I'm working on automating the process of getting the best model for linear regression. Does anyone know a good source that has examples of the dataset and best model for linear regression solved so I can see if I can automate it? Thank you.
Asked
Active
Viewed 24 times
0
-
What do you want to automate? – Dave Oct 21 '21 at 20:24
-
Given the data source, dependent variable, and independent variables I'm determining the best model. – JOakland2021 Oct 21 '21 at 20:48
-
Isn’t that just the least squares fit, $\hat\beta=(X^TX)^{-1}X^Ty?$ – Dave Oct 21 '21 at 20:54
-
I'm self taught and am working with RStudio. Is there an equivalent? – JOakland2021 Oct 21 '21 at 21:00
-
The equivalent in R is lm. Are you familiar with that function? // Do you perhaps mean variable/feature selection? – Dave Oct 21 '21 at 21:15
-
I'm familiar with the lm function. If I have 10 independent variables it may go down to 5 independent variables to get the best model. I'm removing the independent variable with the highest Pr value one at a time. However, hypothetically if you're predicting the value of antique cars and the year may have the highest Pr value you know not to remove it because antique cars' value increase with age. It's these odd ball scenarios that I need to test. – JOakland2021 Oct 21 '21 at 21:27
-
You might find yourself interested in [this](https://stats.stackexchange.com/questions/20836/algorithms-for-automatic-model-selection) question on here. The methodology you propose aligns with the accepted answer, which has, appropriately, been downvoted into oblivion. (In other words, while what you propose first seems to make sense, it turns out to be highly problematic.) – Dave Oct 21 '21 at 21:40
-
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/130744/discussion-between-joakland2021-and-dave). – JOakland2021 Oct 21 '21 at 21:56
-
1Yes, thank you both. – JOakland2021 Oct 21 '21 at 22:30