regression analysis
A very valuable tool for todays manager. Regression Analysis is used to:
Understand the relationship between variables.
Predict the value of one variable based on another variable. A regression model has: dependent, or response, variable - Y axis an independent, or predictor, variable - X axis
Friday, May 25, 12 Nadia Z Khan NUST Business School
regression analysis
Triple A Construction Company renovates old homes in Albany. They have found that its dollar volume of renovation work is dependent on the Albany area payroll.
Local Payroll ($100,000,000's) 3 4 6 4 2 5
Friday, May 25, 12
Scatter plot
10 8
Sales 100,000
6 4 2 0
3
Local Payroll ($100,000,000's)
6
Nadia Z Khan NUST Business School
Y = b0+ b 1X
Where, Y = predicted value of Y
The difference between the actual value of Y and the predicted value (using sample data) is known as the error.
Error = (actual value) (predicted value)
e=Y-Y
Friday, May 25, 12
_ _
12.5 10
= 1.25
Y = 2 + 1.25 X
Y = 42/6 = 7
X = 24/6 = 4
Nadia Z Khan NUST Business School
Correlation Coefcient
r Strength of the relationship between Y and X variables
Standard Error
St Deviation of error around the Regression Line
Residual Analysis
Validation of Model
Coefcient of Determination
R Sq - Proportion of explained variation
Variability
10 8 6 4 2 0 0 1 2
Local Payroll ($100,000,000's)
Friday, May 25, 12
y = 1.25x + 2
R = 0.6944 SSR
explained variability
SSE
SST
_ Y
4
Regression Line
6
Nadia Z Khan NUST Business School
Variability
Errors (deviations) may be positive or negative. Summing the errors would be misleading, thus we square the terms prior to summing.
Sum of Squares Total (SST) measures the total variable in Y. SST = (Y-Y)
2
= 22.5
2
SSE = e 2 = (Y-Y)
= 6.875
Sum of the Squared Error (SSE) is less than the SST because the regression line reduced the variability. SSE = e 2 = (Y-Y) 2 Sum of Squares due to Regression (SSR) indicated how much of the total variability is explained by the regression model. SSR =(Y-Y)2
Friday, May 25, 12
Note:
Coefcient of Determination
The coefficient of determination (r2 ) is the proportion of the variability in Y that is explained by the regression equation.
r2 = SSR = 1 SSE SST SST For Triple A Construction: r2 = 15.625 = 0.6944 22.5
SST, SSR and SSE just themselves provide little direct interpretation. This measures the usefulness of regression
69% of the variability in sales is explained by the regression based on payroll. Note: 0 < r2 < 1
Friday, May 25, 12 Nadia Z Khan NUST Business School
Correlation Coefcient
The correlation coefficient (r) measures the strength of the linear relationship. nXY XY
Possible Scatter Diagrams for values of r.
r=
[nX
(X) ][nY
2
(Y
(Y) ]
Correlation Coefcient
Standard error
The mean squared error (MSE) is the estimate of the error variance of the regression equation.
F = MSR MSE
where, MSR = SSR k
Friday, May 25, 12
The significance level for F = 9.0909 is 0.0394, indicating we reject Ho and conclude a linear relationship exists between sales and payroll. Nadia Z Khan
NUST Business School
The adjusted R Sq takes into account the number of independent variables in the model.
p Value < Alpha (0.05 or 0.1) means relationship between X & Y is linear
Anova table
Residual Analysis:
PITFALLS: Prediction beyond the range of X values in the sample can be misleading, including interpretation of the intercept (X=0). A linear regression model may not be the best model, even in the presence of a significant F test. Nadia Z Khan
NUST Business School Friday, May 25, 12
Constant variance
Triple A Construction
Normal distribution
Histogram of Residuals - Should look like a bell curve
Triple A Construction
Not possible to see the bell curve with just 6 observations. Need more samples
zero mean
Triple A Construction
independent errors
Example: Manager of a package If samples collected over a delivery store wants to predict period of time and not at the weekly sales based on the same time, then plot the number of customers making residues w.r.t time to see if purchases for a period of 100 any pattern (Autocorrelation) days. Data is collected over a period of time so check for exists. autocorrelation (pattern) effect.
Residues
time
multiple regression
multiple regression
Multiple regression models are similar to simple linear regression models except they include more than one X variable.
Wilson Realty wants to develop a model to determine the suggested listing price for a house based on size and age.
Price
35000 47000 49900 55000 58900 60000 67000 70000 78500 79000 87500 93000 95000 97000
Sq. Feet
1926 2069 1720 1396 1706 1847 1950 2323 2285 3752 2300 2525 3800 1740
Age
30 40 30 15 32 38 27 30 26 35 18 17 40 12
Condition
Good Excellent Excellent Good Mint Mint Mint Excellent Mint Good Good Good Excellent Mint
multiple regression
67% of the variation in sales price is explained by size and age. Ho: No linear relationship is rejected
Wilson Realty has found a linear relationship between price and size and age. The coefficient for size indicates each additional square foot increases the value by $21.91, while each additional year in age decreases the value by $1449.34.
Y = 60815.45 + 21.91(size) 1449.34 (age) For a 1900 square foot house that is 10 years old, the following prediction can be made:
dummy variables
Binary (or dummy) variables are special variables that are created for qualitative data.
A dummy variable is assigned a value of 1 if a particular condition is met and a value of 0 otherwise. The number of dummy variables must equal one less than the number of categories of the qualitative variable.
Return to Wilson Realty, and lets evaluate how to use property condition in the regression model. There are three categories: Mint, Excellent, and Good.
X3= 1 if the house is in excellent condition = 0 otherwise X4 = 1 if the house is in mint condition = 0 otherwise Note: If both X and X = 0 then the house is in good condition
dummy variables
As more variables are added to the model, the r2 usually increases.
Y = 48329.23 + 28.21 (size) 1981.41(age) + 23684.62 (if mint) + 16581.32 (if excellent)
model building
adjusted r-Square
The best model is a statistically significant model with a high r2 and a few variables.
As more variables are added to the model, the r2 usually increases. The adjusted r2 takes into account the number of independent variables in the model.
Note: When variables are added to the model, the value of r2 can never decrease; however, the adjusted r2 may decrease.
Friday, May 25, 12
multicollinearity
Collinearity or multicollinearity Duplication of information occurs exists when an independent variable is correlated with another When multicollinearity exists, independent variable.
Collinearity and multicollinearity create problems in the coefficients. The overall model prediction is still good; however individual interpretation of the variables is questionable.
the overall F test is still valid, but the hypothesis tests related to the individual coefcients are not. A variable may appear to be signicant when it is insignicant, or a variable may appear to be insignicant when it is signicant.
Nadia Z Khan NUST Business School Friday, May 25, 12
non-linear regression
non-linear regression
Engineers at Colonel Motors want to use regression analysis to improve fuel efficiency. They are studying the impact of weight on miles per gallon (MPG).
non-linear regression
Nonlinear (transformed variable)regression model
2 MPG = 79.8 30.2(weight) + 3.4(weight)
non-linear regression
We should not try to interpret the coefficients of the variables due to the correlation between (weight) and (weight squared). Normally we would interpret the coefficient for as the change in Y that results from a 1-unit change in X1, while holding all other variables constant. Obviously holding one variable constant while changing the other is impossible in this example since If changes, then must change also. This is an example of a problem that exists when multicollinearity is present.
Nadia Z Khan NUST Business School Friday, May 25, 12