Module 7 Linear Regression
Module 7 Linear Regression
LINEAR REGRESSION
Engr Ren
Definition
• It is used when we want to predict the
value of a variable based on the value of
another variable.
• The variable we want to predict is called
the dependent variable (or sometimes,
the outcome variable).
• The variable we are using to predict the
other variable's value is called the
independent variable (or sometimes, the
predictor variable)
Example
What influence the salary of people?
Example
• Weights of adult males depend to some degree on their
heights
• The circumference of circles depends on their radii
Curve-fitting
• To determine the equation that
connects variables
• Collect data that show
corresponding values of the
variables under consideration
• Plot points using scatterplot
diagram
• b1
• b0=
Another solution
• Finding least squares can be shortened by transforming the data x = X – Mean X
• And y = Y-mean Y
Problem
• Fit a least squares line to the data by using
• (a) X as independent variable
• (b) Estimate the weight of a student in lb whose height
is known to be 63 inches
Solution
0
Solution
Another solution
Another solution
Problem
• Fit a least squares line to the data by using
• (c) Y as independent variable
Problem
• Fit a least squares line to the data by using
• (c) Y as independent variable
Testing the significance of “b”
• The usual approach in testing the significance of “b” is to assume that b=0
• This implies that if b=0, then the two variables are not linearly related.
• When the relationship of two variables is proven to be linear, then we can say that
the variable X can be used in predicting the value of Y.
STEPS
• 1. State the hypothesis
• 2. state the level of significance and df
• 3. get the tabular value of t
• 4. Solve for t
𝑏′
• t= ; where b’=slope of the regression line
𝑆𝑏 ′
• Sb’ = standard error of estimate
Σ𝑒 2
• Sb’ =
(𝑛−2)Σ𝑑 2
• 5. Decision
• 6. Conclusion
Problem
• Test the significance of regression coefficient “b” based from the prev problem.
Problem
• Test the significance of regression coefficient “b” based from the prev problem.
Problems Involving Two Variables
X Y Z
1 10 12
2 1 18
3 2 24
4 3 30
Solution
Solution
AS2
1. The table below shows the data from the computer sales since 1960 to 1969.
YEAR COST(X) SALES(Y)
1960 15 38
1961 30 53
1962 16 60
X Y Z X Y Z