0
$\begingroup$

I'm just learning about multiple regression so I'm trying to better understand what the point of what I'm doing is.

If I use lm() on some data in R with one response variable and multiple independent variables, what I seem to get with its summary() is a series results that tell me which independent variables have statistically significant relationships with the response variable (the t-tests) and another result that tells me if the combination of the independent variables had a significant relationship with the response variable all together (the F-test). To me, that all seems to be about hypothesis testing, and not about creating a model that would predict the response variable, but I'm being taught all of this simply as "multiple regression modeling". Intuitively, it would seem like the "modeling" aspect only comes after the tests when I drop the non-significant independent variables and try to use the coefficients I'm left with to see if they'll accurately predict the value of the same response variable on some new data. Am I right in thinking that I'm initially performing hypothesis tests and then attempting to create a predictive model as a second independent step?

As a very simplified example, say I want to know if diet, exercise, genetics, and/or religious belief lead to good health. I could use lm() with diet, exercise, genetics, and religious belief as independent variables and health as the response variable, and the summary() would give me P-values telling me which of those independent variables have something to do with good health. That would be the conclusion of my hypothesis test, correct?

Now say that I wanted to use these results to predict whether someone will be healthy (i.e., create a predictive model). Hypothetically, my results from the previous test suggested that religious belief is not an important factor, so in my predictive model I only use diet, exercise, and genetics with the coefficient values from the previous step and use that as a model for predicting someone's health. I could look into whether the model was accurate or not, but this could essentially be the conclusion of building my predictive multiple regression model, correct?

$\endgroup$
0
$\begingroup$

lm() performs least squares regression to fit linear models. You can use the object returned by the function to make predictions based on new values of the input variables (use the predict() method). As you mentioned the summary table provides estimates of the coefficients as well as the standard test statistics and their related p-values.

These results can be used to do stepwise regression by successively fitting a model, then removing "insignificant" input variables from the model, refitting, etc. If following that procedure, it is advised that you refit the model without the subtracted input variable, which will almost certainly change the other coefficient estimates.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.