Docsity

Regression Analysis: Simple and Multiple Linear Regression Models, Sintesi del corso di Statistica

Toggle sidebar
bg1
Regression analysis is a tool for building mathematical and statistical models that characterise
relationships between a dependent variable and one or more independent (explanatory)
variables. Most of the times, all these variables are numerical. !
2 categories of regression models:!
•Simple linear regression= it involves a single independent variable;!
•Multiple linear regression= it involves two or more independent variables;!
Simple linear regression aims to find a linear relationship between 1 independent (X) and 1
dependent (Y) variables. The first step is to verify if the relation is linear or not, by creating a
scatter chart that shows the relation visually. !
Simple linear regression is designed to find the best fitting regression line (the one in which
point of the graph are closer to the line) by minimising errors. Regression models are in fact
commonly used as they provide better estimates of market values than simply using averages.!
Least-square regression are the mathematical basis for best-fitting regression line. Taking a data
set of a sample and assuming it has a linear regression, the dependent variable Y is obtained
by summing coefficients of population parameters. Yet, since data come from a sample, the
coefficients of the population are unknown, and so the formula uses estimates of these
coefficients. They respectively are the intercept (b0) and the slope (b1).!
Since the formula uses population estimates, there can be find residuals. They are the observed
errors given by the difference between the actual value and the estimated value of the dependent
variable (actual Y - predicted Y). Focusing on standard residuals, they are particularly useful in
detecting outliers (if the value is outside the range +2;-2, we’re dealing with a potential residual).!
2 ways of test for significance: !
1. ANOVA (analysis of variance) can also be applied to regressions to test for significance of
regression, which is a hypothesis test to determine if the regression coefficient (slope) is equal
zero. Thus:!
•H0 –> population slope coefficient = 0 –> no correlation!
•H1 –> population slope coefficient ≠ 0 –> correlation !
If H0 is rejected, then it shows a statistical significance, thus a variation of X variables will cause
variation of Y variables.!
!
2. T-test -> another way to test if the slope or the intercept is zero or not. The formula for this test
statistic is t = (b1 – 0) / standard error. This output also provides the p-value for the test, thus
there will be a rejection and a non-rejection region to discover if the variables are correlated.!
Key assumptions to check:!
-Linearity -> linear scatter diagram and random residual plot!
-Normality of errors -> by examining a histogram of standard residuals, the graph must
represent a bell-shaped curve!
-Homosedasticity -> when the variation about the regression line is constant for all the values X!
-Independence of errors -> when residuals are independent for each value of X!
Multiple linear regression aims to find a linear relationship between 1 dependent (Y) and 2 or
more independent (X) variables. Because usually a dependent variable depends on more than
just one independent variable (EG. On what depends students’ performances (Y)? Different
factors like: satisfaction, the acceptance rate, the average students’ expenditure -> they all are
independent (X). Here again the SLOPE and the INTERCEPT are estimates and represent the
expected change in the dependent (Y), while the associated independent (X) is increased by 1 unit
(and the others independent remain unvaried). !
Here ANOVA test will consider the entire model. F-test for testing the following hypothesis:!
•H0 –> every regression coeff. Of independent variables = 0 –> no correlation!
•H1 –> at least one coefficient ≠ 0 –> correlation!
If H0 is rejected, then the independent variable is significant, and so, improves the ability of the
model to better predict the dependent variable. On the other hand, if H0 is not rejected, the
independent variable is not significant and it shouldn’t be included in the model. !
pf2

Anteprima parziale del testo

Scarica Regression Analysis: Simple and Multiple Linear Regression Models e più Sintesi del corso in PDF di Statistica solo su Docsity!

Regression analysis is a tool for building mathematical and statistical models that characterise

relationships between a dependent variable and one or more independent (explanatory)

variables. Most of the times, all these variables are numerical.

2 categories of regression models:

Simple linear regression= it involves a single independent variable;

Multiple linear regression= it involves two or more independent variables;

Simple linear regression aims to find a linear relationship between 1 independent (X) and 1

dependent (Y) variables. The first step is to verify if the relation is linear or not, by creating a

scatter chart that shows the relation visually.

Simple linear regression is designed to find the best fitting regression line (the one in which

point of the graph are closer to the line) by minimising errors. Regression models are in fact

commonly used as they provide better estimates of market values than simply using averages.

L east-square regression are the mathematical basis for best-fitting regression line. Taking a data

set of a sample and assuming it has a linear regression, the dependent variable Y is obtained

by summing coefficients of population parameters. Yet, since data come from a sample, the

coefficients of the population are unknown, and so the formula uses estimates of these

coefficients. They respectively are the intercept ( b 0

) and the slope ( b 1

Since the formula uses population estimates , there can be find residuals. They are the observed

errors given by the difference between the actual value and the estimated value of the dependent

variable (actual Y - predicted Y). Focusing on standard residuals, they are particularly useful in

detecting outliers (if the value is outside the range +2;-2, we’re dealing with a potential residual).

2 ways of test for significance:

  1. ANOVA (analysis of variance) can also be applied to regressions to test for significance of

regression, which is a hypothesis test to determine if the regression coefficient ( slope ) is equal

zero. Thus:

• H

0

–> population slope coefficient = 0 –> no correlation

• H

1

–> population slope coefficient ≠ 0 –> correlation

If H 0

is rejected, then it shows a statistical significance , thus a variation of X variables will cause

variation of Y variables.

  1. T-test -> another way to test if the slope or the intercept is zero or not. The formula for this test

statistic is t = ( b 1

- 0) / standard error. This output also provides the p-value for the test, thus

there will be a rejection and a non-rejection region to discover if the variables are correlated.

Key assumptions to check:

  • Linearity -> linear scatter diagram and random residual plot
  • Normality of errors -> by examining a histogram of standard residuals, the graph must

represent a bell-shaped curve

  • Homosedasticity -> when the variation about the regression line is constant for all the values X
  • Independence of errors -> when residuals are independent for each value of X

Multiple linear regression aims to find a linear relationship between 1 dependent (Y) and 2 or

more independent (X) variables. Because usually a dependent variable depends on more than

just one independent variable (EG. On what depends students’ performances (Y)? Different

factors like: satisfaction, the acceptance rate, the average students’ expenditure -> they all are

independent (X). Here again the SLOPE and the INTERCEPT are estimates and represent the

expected change in the dependent (Y), while the associated independent (X) is increased by 1 unit

(and the others independent remain unvaried).

Here ANOVA test will consider the entire model. F-test for testing the following hypothesis:

• H

0

–> every regression coeff. Of independent variables = 0 –> no correlation

• H

1

–> at least one coefficient ≠ 0 –> correlation

If H0 is rejected, then the independent variable is significant, and so, improves the ability of the

model to better predict the dependent variable. On the other hand, if H0 is not rejected, the

independent variable is not significant and it shouldn’t be included in the model.

MODEL BUILDING

A good regression model should include only signifiant independent variables. The

Adjusted Rsquare is an important indicator, it will increase or decrease by adding or

dropping variables. If Adjusted Rsquare increases, then the model has improved.

SYSTEMATIC MODEL BUILDING APPROACH requires 4 steps:

Construct the model with all the available independent variables, then check for

significance by examining the p-value

Find the independent variable with the largest p-value

Remove this variable and evaluate the Adjusted Rsquare (if more the one variable

exceed the p-value, remove them only one at time)

Continues till all variables are significant

Good model builders should apply the principle of parsimony. A good model is as simple

as possible (more variables more difficult to be represented). Another issue is the

overfitting. It occurs when the model fit too closely the sample data, but since samples may

have unusual variability different from population, there’s the risk of a model not fitting the real

population. In multiple regressions, if too many terms are added to the model, then it may not

adequately predict other values from the population. It can be mitigated by using good logic ,

intuition and theory.

MULTICOLLINEARITY -> when there are strong correlations among the independent

variables. When correlations exceed a value of +-0,7 it may indicate multicollinearity.

Another indicator could be the variance inflation factor (VIF).

MULTICOLLINEARITY VS INTERACTION

You want to analyse the performance of a hotel (dependent var.) by checking many

independent var., such as price, promotion, advertisement, quality...

You find out that promotion and advs are correlated -> here you have multicollinearity

(correlation of 2 independent var.)

Now you have 2 options:

1) exclude the less relevant from the regression model (probably the ads since they are

less important). By doing so, you resolve multicollinearity, but you cannot see the effects

of advertisement anymore. OR

2) you decide to see if a combination of both promotion and advs impact on the hotel

performances. If both variables are performed at THE SAME TIME AND IN THE SAME

SPACE and you can combine them, this is interaction (multiplication of promotion and

advs) with this "new variable" (the combination) you can see if the regression model

improves.

To sum up: first it comes multicollinearity, then you decide how to behave (exclude

the less relevant or combine them with interaction).