Ways of Testing Linearity Assumption in Multiple Regression apart from Residual Plots
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I was going through the assumptions of linear regression and of course one of them was linearity between the dependent and the independent variables - to be precise I should say that the assumption is the conditional mean of Yi given Xi is linear in the parameters.
I looked in many textbooks and resources online and all of them suggested to check that assumption through a scatter plot of the residuals versus the fitted values. Although I can see that this is a valid and helpful way, I can't help but notice that it can be a bit arbitrary and subjective in some cases.
My question is if there is a statistical test to examine that assumption as well. For example when testing heteroscedasticity we can see the residual plot but we also have Levene's test.
I can see in that in How can I use the value of $R^2$ to test the linearity assumption in multiple regression analysis? ,which is very helpful, it stated the R squared is not that statistic but doesn't mention anything as a viable alternative.
Thanks in advance
multiple-regression assumptions linearity
add a comment |Â
up vote
1
down vote
favorite
I was going through the assumptions of linear regression and of course one of them was linearity between the dependent and the independent variables - to be precise I should say that the assumption is the conditional mean of Yi given Xi is linear in the parameters.
I looked in many textbooks and resources online and all of them suggested to check that assumption through a scatter plot of the residuals versus the fitted values. Although I can see that this is a valid and helpful way, I can't help but notice that it can be a bit arbitrary and subjective in some cases.
My question is if there is a statistical test to examine that assumption as well. For example when testing heteroscedasticity we can see the residual plot but we also have Levene's test.
I can see in that in How can I use the value of $R^2$ to test the linearity assumption in multiple regression analysis? ,which is very helpful, it stated the R squared is not that statistic but doesn't mention anything as a viable alternative.
Thanks in advance
multiple-regression assumptions linearity
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I was going through the assumptions of linear regression and of course one of them was linearity between the dependent and the independent variables - to be precise I should say that the assumption is the conditional mean of Yi given Xi is linear in the parameters.
I looked in many textbooks and resources online and all of them suggested to check that assumption through a scatter plot of the residuals versus the fitted values. Although I can see that this is a valid and helpful way, I can't help but notice that it can be a bit arbitrary and subjective in some cases.
My question is if there is a statistical test to examine that assumption as well. For example when testing heteroscedasticity we can see the residual plot but we also have Levene's test.
I can see in that in How can I use the value of $R^2$ to test the linearity assumption in multiple regression analysis? ,which is very helpful, it stated the R squared is not that statistic but doesn't mention anything as a viable alternative.
Thanks in advance
multiple-regression assumptions linearity
I was going through the assumptions of linear regression and of course one of them was linearity between the dependent and the independent variables - to be precise I should say that the assumption is the conditional mean of Yi given Xi is linear in the parameters.
I looked in many textbooks and resources online and all of them suggested to check that assumption through a scatter plot of the residuals versus the fitted values. Although I can see that this is a valid and helpful way, I can't help but notice that it can be a bit arbitrary and subjective in some cases.
My question is if there is a statistical test to examine that assumption as well. For example when testing heteroscedasticity we can see the residual plot but we also have Levene's test.
I can see in that in How can I use the value of $R^2$ to test the linearity assumption in multiple regression analysis? ,which is very helpful, it stated the R squared is not that statistic but doesn't mention anything as a viable alternative.
Thanks in advance
multiple-regression assumptions linearity
multiple-regression assumptions linearity
asked 1 hour ago
ALEX.VAMVAS
214
214
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
What you can do is fit a model that relaxes the linearity assumption, using, e.g., splines, and compare it with the model that assumes linearity. For example, in R, for a linear regression model you can do something like that:
library("splines")
# linear effect of age on y
fm_linear <- lm(y ~ age + sex, data = your_data)
# nonlinear effect of age on y using natural cubic splines
fm_non_linear <- lm(y ~ ns(age, 3) + sex, data = your_data)
# F-test between the two models
anova(fm_linear, fm_non_linear)
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
What you can do is fit a model that relaxes the linearity assumption, using, e.g., splines, and compare it with the model that assumes linearity. For example, in R, for a linear regression model you can do something like that:
library("splines")
# linear effect of age on y
fm_linear <- lm(y ~ age + sex, data = your_data)
# nonlinear effect of age on y using natural cubic splines
fm_non_linear <- lm(y ~ ns(age, 3) + sex, data = your_data)
# F-test between the two models
anova(fm_linear, fm_non_linear)
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
add a comment |Â
up vote
3
down vote
What you can do is fit a model that relaxes the linearity assumption, using, e.g., splines, and compare it with the model that assumes linearity. For example, in R, for a linear regression model you can do something like that:
library("splines")
# linear effect of age on y
fm_linear <- lm(y ~ age + sex, data = your_data)
# nonlinear effect of age on y using natural cubic splines
fm_non_linear <- lm(y ~ ns(age, 3) + sex, data = your_data)
# F-test between the two models
anova(fm_linear, fm_non_linear)
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
add a comment |Â
up vote
3
down vote
up vote
3
down vote
What you can do is fit a model that relaxes the linearity assumption, using, e.g., splines, and compare it with the model that assumes linearity. For example, in R, for a linear regression model you can do something like that:
library("splines")
# linear effect of age on y
fm_linear <- lm(y ~ age + sex, data = your_data)
# nonlinear effect of age on y using natural cubic splines
fm_non_linear <- lm(y ~ ns(age, 3) + sex, data = your_data)
# F-test between the two models
anova(fm_linear, fm_non_linear)
What you can do is fit a model that relaxes the linearity assumption, using, e.g., splines, and compare it with the model that assumes linearity. For example, in R, for a linear regression model you can do something like that:
library("splines")
# linear effect of age on y
fm_linear <- lm(y ~ age + sex, data = your_data)
# nonlinear effect of age on y using natural cubic splines
fm_non_linear <- lm(y ~ ns(age, 3) + sex, data = your_data)
# F-test between the two models
anova(fm_linear, fm_non_linear)
answered 58 mins ago
Dimitris Rizopoulos
1,53319
1,53319
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
add a comment |Â
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
Hello Dimitri. Thanks for the quick response. So if I understand it correctly unlike the other assumptions of heteroscedasticity and multicollinearity, which affect the accuracy (for lack of a better word) of the OLS estimators, linearity is an assumptions that refers to the relationship between the dependent and the independent variables. We can still use OLS if it is violated but we should not have a straight line model but rather one with splines and the way to test that would be through ANOVA. Is that a correct conclusion? Also instead of ANOVA could we use the R squared?
â ALEX.VAMVAS
26 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstats.stackexchange.com%2fquestions%2f370506%2fways-of-testing-linearity-assumption-in-multiple-regression-apart-from-residual%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password