# Linear regression assumptions relationship

### Linear Regression Analysis in SPSS Statistics - Procedure, assumptions and reporting the output.

"Linearity is the property of a mathematical relationship or function whic "This assumption means that the variance around the regression line is the same for. Four assumptions of regression. Testing for linear and additivity of predictive relationships. Testing for independence (lack of correlation) of errors. Testing for . How to perform a simple linear regression analysis using SPSS Statistics. Assumption #2: There needs to be a linear relationship between the two variables.

Usually, a VIF value of above 5 or 10 is taken as an indicator of multicollinearity. The simplest way of getting rid of multicollinearity in that case is to discard the predictor with high value of VIF. By applying linear regression, we are assuming that there is a linear relationship between the predictors and the outcome. If the underlying relationship is quite far from linear, then most of the inferences we would make would be doubtful. The non-linearity of the model can be determined using the residual plot of fitted values versus the residuals.

Residual for any observation is the difference between the actual outcome and the fitted outcome as per the model. Presence of a pattern in the residual plot would imply a problem with the linear assumption of the model.

The curve in our case denotes slight non-linearity in our data. The non-linearity can be further explored by looking at Component Residual plots CR plots. The blue dashed line component line is for the line of best fit.

This kind of inconsistency can be seen in the CR plot for bmi. One of the methods of fixing this is introducing non-linear transformation of predictors of the model.

A person who smokes and has a high bmi may have higher charges as compared to a person who has lower bmi and is a non-smoker. The error terms may, for instance, change with the value of the response variable in case of non-constant variance heteroscedasticity of errors. Some of the graphical methods of identifying heteroscedasticity is presence of a funnel shape in the residual plot, or existence of a curve in the residual plot.

A statistical way is an extension of the Breusch-Pagan Test, available in R as ncvTest in the cars package. For each value of X, the distribution of residuals has the same variance.

This means that the level of error in the model is roughly the same regardless of the value of the explanatory variable homoscedasticity - another disturbingly complicated word for something less confusing than it sounds.

This means that residuals errors should be uncorrelated. It may seem as if we're complicating matters but checking that the analysis you perform is meeting these assumptions is vital to ensuring that you draw valid conclusions. Other important things to consider The following issues are not as important as the assumptions because the regression analysis can still work even if there are problems in these areas.

However it is still vital that you check for these potential issues as they can seriously mislead your analysis and conclusions.

It is important to look out for cases which may unduly influence your regression model by differing substantially to the rest of your data. The residuals errors in prediction should be normally distributed. Let us look at these assumptions and related issues in more detail - they make more sense when viewed in the context of how you go about checking them.

### 10 Assumptions of Linear Regression - Full List with Examples and Code

Checking the assumptions The below points form an important checklist: First of all remember that for linear regression the outcome variable must be continuous. There must be a roughly linear relationship between the explanatory variable and the outcome. Inspect your scatterplot s to check that this assumption is met. You may run into problems if there is a restriction of range in either the outcome variable or the explanatory variables.

This is hard to understand at first so let us look at an example. The moral of the story is that your sample must be representative of any dimensions relevant to your research question.

## Linear Regression Analysis using SPSS Statistics

If you wanted to know the extent to which exam score at age 11 predicted to exam score at age 14 you will not get accurate results if you sample only the high ability students! Interpret r2 with caution - if you reduce the range of values of the variables in your analysis than you restrict your ability to detect relationships within the wider population.

Look out for outliers as they can substantially reduce the correlation. Here is an example of this: Models of this kind are commonly used in modeling price-demand relationships, as illustrated on the beer sales example on this web site.

Another possibility to consider is adding another regressor that is a nonlinear function of one of the other variables. Higher-order terms of this kind cubic, etc. This sort of "polynomial curve fitting" can be a nice way to draw a smooth curve through a wavy pattern of points in fact, it is a trend-line option on scatterplots on Excelbut it is usually a terrible way to extrapolate outside the range of the sample data.

## Assumptions of Linear Regression

Finally, it may be that you have overlooked some entirely different independent variable that explains or corrects for the nonlinear pattern or interactions among variables that you are seeing in your residual plots. In that case the shape of the pattern, together with economic or physical reasoning, may suggest some likely suspects. For example, if the strength of the linear relationship between Y and X1 depends on the level of some other variable X2, this could perhaps be addressed by creating a new independent variable that is the product of X1 and X2.

In the case of time series data, if the trend in Y is believed to have changed at a particular point in time, then the addition of a piecewise linear trend variable one whose string of values looks like 0, 0, …, 0, 1, 2, 3, … could be used to fit the kink in the data. Such a variable can be considered as the product of a trend variable and a dummy variable. Again, though, you need to beware of overfitting the sample data by throwing in artificially constructed variables that are poorly motivated.

### What are the four assumptions of linear regression? | Gaurav Bansal

At the end of the day you need to be able to interpret the model and explain or sell it to others. Violations of independence are potentially very serious in time series regression models: Independence can also be violated in non-time-series models if errors tend to always have the same sign under particular conditions, i.

The best test for serial correlation is to look at a residual time series plot residuals vs. If your software does not provide these by default for time series data, you should figure out where in the menu or code to find them.

Pay especially close attention to significant correlations at the first couple of lags and in the vicinity of the seasonal period, because these are probably not due to mere chance and are also fixable. The Durbin-Watson statistic provides a test for significant residual autocorrelation at lag 1: Minor cases of positive serial correlation say, lag-1 residual autocorrelation in the range 0. An AR 1 term adds a lag of the dependent variable to the forecasting equation, whereas an MA 1 term adds a lag of the forecast error.

If there is significant correlation at lag 2, then a 2nd-order lag may be appropriate. If there is significant negative correlation in the residuals lag-1 autocorrelation more negative than Differencing tends to drive autocorrelations in the negative direction, and too much differencing may lead to artificial patterns of negative correlation that lagged variables cannot correct for. If there is significant correlation at the seasonal period e. Seasonality can be handled in a regression model in one of the following ways: The dummy-variable approach enables additive seasonal adjustment to be performed as part of the regression model: If the dependent variable has been logged, the seasonal adjustment is multiplicative.

Something else to watch out for: Major cases of serial correlation a Durbin-Watson statistic well below 1. You may wish to reconsider the transformations if any that have been applied to the dependent and independent variables.

To test for non-time-series violations of independence, you can look at plots of the residuals versus independent variables or plots of residuals versus row number in situations where the rows have been sorted or grouped in some way that depends only on the values of the independent variables.

The residuals should be randomly and symmetrically distributed around zero under all conditions, and in particular there should be no correlation between consecutive errors no matter how the rows are sorted, as long as it is on some criterion that does not involve the dependent variable.

If this is not true, it could be due to a violation of the linearity assumption or due to bias that is explainable by omitted variables say, interaction terms or dummies for identifiable conditions.