2. Regression Analysis
using Excel 2007
MTH 305 Statistics
Data Needed in Regression AnalysisAt least two variables that
have information about several observations
Only one variable will be defined as the Y variable. There can
be one or more X variables in regression analysis.Observation
IDVariable 1Variable 2123
Data ExampleFor example, we are interested in analyzing the
linear relationship between amount of sugar and calories in a
box of cereals. We are testing whether sugar amount causes
3. calories amount. In Excel the dataset will look like…see next
slide
Data Example
Ways to Check Linear Relationship
Scatter Plot between Y and X
Correlation Value
Regression Analysis
SCATTER PLOT
Scatter-plot of Two variablesSelect the data of two variables
t
“scatter plot”Example from data above:
Looks like there is no linear relationshiip!!!
CORRELATION COEFFICIENT
Correlation Value in ExcelIn any Excel cell, type:
=CORREL(range of Y data, range of X data)For example, for
the dataset above (cereal data) where Y data are in cells B2
4. through B19 and X data are in cells C2 through C19, we will
type:
=CORREL(B2:B19, C2:C19)
The result of 0.2296 shows that there is a weak relationship
between those variables.
REGRESSION ANALYSIS
Regression Analysis
Excel Output: Intercept and Slope
The regression equation is:Regression StatisticsMultiple
R0.76211R Square0.58082Adjusted R Square0.52842Standard
Error41.33032Observations10ANOVA
dfSSMSFSignificance
FRegression118934.934818934.934811.08480.01039Residual81
3665.56521708.1957Total932600.5000CoefficientsStandard
Errort StatP-valueLower 95%Upper
95%Intercept98.2483358.033481.692960.12892-
35.57720232.07386Square
Feet0.109770.032973.329380.010390.033740.18580
5. Excel Output: R-squared
58.08% of the variation in house prices is explained by
variation in square feet
Regression StatisticsMultiple R0.76211R
Square0.58082Adjusted R Square0.52842Standard
Error41.33032Observations10ANOVA
dfSSMSFSignificance
FRegression118934.934818934.934811.08480.01039Residual81
3665.56521708.1957Total932600.5000CoefficientsStandard
Errort StatP-valueLower 95%Upper
95%Intercept98.2483358.033481.692960.12892-
35.57720232.07386Square
Feet0.109770.032973.329380.010390.033740.185 80
9. 0
0
0
0
0
0
0
0
0
0
Sheet2
Sheet3
MULTIVARIATE REGRESSION
Multivariate Regression
Multivariate = two or more X variables than influence YScatter -
Plot: get them separately for each pair of X and Y.Correlation
Coefficient: compute them separately for each pair of X and
Y.Regression Analysis: If we want to analyze how two or more
X variables have an impact on Y, then we will do the same as
above for the case of one X but select the data in all the X
variables at the same time.
feet)
(square
0.10977
98.24833