Happiness comes not from material wealth but less desire.
description
Transcript of Happiness comes not from material wealth but less desire.
![Page 1: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/1.jpg)
1
Happiness comes not from material wealth but less desire.
![Page 2: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/2.jpg)
2
Applied Statistics Using SAS and SPSS
Topic: Simple linear regression
By Prof Kelly Fan, Cal State Univ, East Bay
![Page 3: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/3.jpg)
3
Example: Computer Repair
A company markets and repairs small computers. How fast (Time) an electronic component (Computer Unit) can be repaired is very important to the efficiency of the company. The Variables in this example are:
Time and Units.
![Page 4: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/4.jpg)
4
Humm… How long will it take
me to repair this unit?
Goal: to predict the length of repair Time for a given number of computer Units
![Page 5: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/5.jpg)
5
Computer Repair Data
Units Min’s Units Min’s
1 23 6 97
2 29 7 109
3 49 8 119
4 64 9 149
4 74 9 145
5 87 10 154
6 96 10 166
![Page 6: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/6.jpg)
6
Scatterplot of response variable against explanatory variable
What is the overall (average) pattern?What is the direction of the pattern? How much do data points vary from the overall (average)
pattern?Any potential outliers?
Graphical Summary of Two Quantitative Variable
![Page 7: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/7.jpg)
7
Time is Linearly related with computer Units.
(The length of) Time is Increasing as (the number of) Units increases.
Data points are closed to the line.
No potential outlier.
Scatterplot (Time vs Units) Some Simple Conclusions
Summary for Computer Repair Data
![Page 8: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/8.jpg)
8
Numerical Summary of Two Quantitative Variable
Regression equation
Correlation
![Page 9: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/9.jpg)
9
Review: Math Equation for a Line
Y: the response variableX: the explanatory variable
X
Y Y=b0+b1X
} b0
} b1
1
![Page 10: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/10.jpg)
10
Regression Equation
The regression line models the relationship between X and Y on average.
The math equation of a regression line is called regression equation.
![Page 11: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/11.jpg)
11
The Usage of Regression Equation
Predict the value of Y for a given X valueEg. How long will it take to repair 3
computer units?
![Page 12: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/12.jpg)
12
General Notation
is called “predicted Y,” pronounced as “y hat,” which estimates the average Y value for a specified X value.
Eg.
The predicted repair time of a given # of units
XY 51.1516.4ˆ
XbbY 10ˆ
![Page 13: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/13.jpg)
13
The Limitation of the Regression Equation
The regression equation cannot be used to predict Y value for the X values which are (far) beyond the range in which data are observed.
Eg. The predicted WT of a given HT:
Given HT of 40”, the regression equation will give us WT of -205+5x40 = -5 pounds!!
XY 5205ˆ
![Page 14: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/14.jpg)
14
The Unpredicted Part
The value is the part the regression equation (model) cannot predict, and it is called “residual.”
YY ˆ
![Page 15: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/15.jpg)
15
residual {
![Page 16: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/16.jpg)
16
Correlation between X and Y
X and Y might be related to each other in many ways: linear or curved.
![Page 17: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/17.jpg)
17
x
y
0.0 0.2 0.4 0.6 0.8 1.0
1.2
1.4
1.6
1.8
2.0
2.2
x
y
0.0 0.2 0.4 0.6 0.8 1.0
1.5
2.0
2.5
3.0
r=.98Strong Linearity
r=.71Median Linearity
Examples of Different Levels of Correlation
![Page 18: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/18.jpg)
18
x
y
0.0 0.2 0.4 0.6 0.8 1.0
2.0
2.5
3.0
3.5
4.0
r=-.09Nearly Uncorrelated
Examples of Different Levels of Correlation
x
y
0.0 0.2 0.4 0.6 0.8 1.0
1.0
1.5
2.0
2.5
3.0
r=.00Nearly Curved
![Page 19: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/19.jpg)
19
(Pearson) Correlation Coefficient of X and Y
A measurement of the strength of the “LINEAR” association between X and Y
Sx: the standard deviation of the data values in X, Sy: the standard deviation of the data values in Y;the correlation coefficient of X and Y is:
xy
n
iii
ssn
xxyyr
)1(
))((1
![Page 20: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/20.jpg)
20
Correlation Coefficient of X and Y
-1< r < 1The magnitude of r measures the strength
of the linear association of X and YThe sign of r indicate the direction of the
association: “-” negative association“+” positive
association
![Page 21: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/21.jpg)
21
Goodness of Fit
R^2 is the proportion of Y variance explained/accounted by the model we use to fit the data
When there is only one X (simple linear regression) R^2 = r^2.
![Page 22: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/22.jpg)
22
SPSS Output
Analyze >> Regression >> Linear
Model Summaryb
.994a .987 .986 5.39172Model1
R R SquareAdjustedR Square
Std. Error ofthe Estimate
Predictors: (Constant), unitsa.
Dependent Variable: timeb.
ANOVAb
27419.509 1 27419.509 943.201 .000a
348.848 12 29.07127768.357 13
RegressionResidualTotal
Model1
Sum ofSquares df Mean Square F Sig.
Predictors: (Constant), unitsa.
Dependent Variable: timeb.
![Page 23: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/23.jpg)
23
Confidence Intervals
Coefficientsa
4.162 3.355 1.240 .239 -3.148 11.47215.509 .505 .994 30.712 .000 14.409 16.609
(Constant)units
Model1
B Std. Error
UnstandardizedCoefficients
Beta
StandardizedCoefficients
t Sig. Lower Bound Upper Bound95% Confidence Interval for B
Dependent Variable: timea.
![Page 24: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/24.jpg)
24
Check for Normality
![Page 25: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/25.jpg)
25
Check for Equal VariancesSCATTERPLOT of zresid & zpred
![Page 26: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/26.jpg)
26
4 6 8 10 12 14X3
5
7
9
11
13
Y3
The Influence of Outliers
The slope becomes smaller (toward outliers)
The r value becomes smaller (less linear)
![Page 27: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/27.jpg)
27
The slope becomes clear (toward outliers)
The | r | value becomes larger (more linear: 0.1590.935)
The Influence of Outliers
x
y
1086420
5
4
3
2
1
0
Scatterplot of y vs x
![Page 28: Happiness comes not from material wealth but less desire.](https://reader036.fdocuments.in/reader036/viewer/2022070502/56814d09550346895dba3f4d/html5/thumbnails/28.jpg)
28
Identify Outliers using Residual Plots
Use “standardized” residuals!!
The cases with standardized residuals of size 3 or more outliers