Post on 24-Feb-2022
transcript
Simple Linear Regression
β’ Linear regression models are used to describe or predict the relationship between two variables
β π₯ and π¦ β. The simple linear regression model is represented by:
π¦ = π½0 + π½1π₯ + π
π·π
π·π
π¦ : The factor that is being predicted (the factor that the equation
solves for) is called the dependent variable.
π₯ : The factors that are used to predict the value of the
dependent variable are called the independent variables.
π : Is the error of the estimate. The error term is used to account
for the variability in π¦ that cannot be explained by the linear
relationship between π₯ and π¦.
π½0 : Is the y-intercept of the regression line.
π½1 : Is the slope.
The Estimated Linear Regression Equation
β’ In practice, the parameter of the population values generally are not known so they must
be estimated by using data from a sample of the population. The population parameters
are estimated by using sample statistics. The sample statistics are represented by π0 and
π1. When the sample statistics are substituted for the population parameters, the estimated
regression equation is formed as follow:
πΈ π¦ = ΰ·π¦ = π0 + π1π₯, π€βπππ
π0 = πΈ π½0 = π¦ β π1π₯,
and
π1 = πΈ π½1 = ππ π¦
π π₯
β’ the error in the predicted value of π at a
certain value of π:
Error = ΰ·π β πβ’ The coefficient of determination ππ:
how well does the regression equation fit the
data. This means that % of the variation in πcan be described by π.
Sheet (3)
12. Last year, five randomly selected students took a math aptitude test before they
began their statistics course. The Statistics Department has three questions.
Student ππ ππ
1 95 85
2 85 95
3 80 70
4 70 65
5 60 70
β’ Draw the scatter plot representing the data
β’ What linear regression equation best predicts statistics performance, based on math
aptitude scores?
β π = 5
β π =Οπ=15 π₯π
π=
95+β―+60
5= 78
β π π₯ =Οπ=15 π₯βπ₯ 2
πβ1=
95β78 2+β―+ 95β78 2
4=13.5093
β π¦ =Οπ=15 π¦π
π=
85+β―+70
5= 77
β π π¦ =Οπ=15 π¦βπ¦ 2
πβ1=
85β77 2+β―+ 70β77 2
4=12.5499
β ΰ·π¦ = π0 + π1π₯
β’ π1 = ππ π¦
π π₯
= 0.693112.5499
13.5093
= 0.644
β’ π0 = π¦ β π1π₯ = 77 β 0.644 β 78
= 26.768
ΰ·π¦ = 26.768 + 0.644 π₯
π₯ππ =
π β ππ
ππ. ππππ
πππ =
π β ππ
ππ. ππππ
ππππ
95 1.2584 85 0.6375 0.8022
85 0.5182 95 1.4343 0.7433
80 0.1480 70 β0.5578 β0.0826
70 β0.5922 65 β0.9562 0.5663
60 β1.3324 70 β0.5578 0.7432
Total = 2.7724
π =Οπ§π₯π§π¦π β 1
=2.7724
4= 0.6931
β’ If a student made an 80 on the aptitude test, what grade would we expect her to
make in statistics?
At π₯ = 80 ΰ·π¦80 = 26.768 + 0.644 β 80 = 78.288.
Error= ΰ·π¦ β π¦ = 78.288 β 70 = 8.288
β’ How well does the regression equation fit the data? (hint: use the coefficient of
determination to answer this question).
π2 = 0.6931 2 = 0.4804 Γ 100 = 48.04% of the variation in π can be
described by π.
Bayesβ Rule
β’ Bayes' theorem, is a mathematical formula for determining conditional probability. Conditional
probability is the likelihood of an outcome occurring, based on a previous outcome occurring.
Bayes' theorem provides a way to revise existing predictions or theories (update probabilities)
given new or additional evidence
π¨π
π¨π
π¨π
β¦
π· π¨π
π
π©π·(π©|π¨π)
π·(π©|π¨π)
π·(π©|π¨π²)
π©
π©
πβ©
π·(π¨πβ© π©) = π·(π©|π¨π)π·(π¨π)
π·(π¨πβ© π©) = π·(π©|π¨π)π·(π¨π)
π·(π¨πβ© π©) = π·(π©|π¨π)π·(π¨π)
β¦β¦
π· π©
β’ π· π© = π·(π¨πβ© π©) + π·(π¨πβ© π©) +β―+ π·(π¨πβ© π©)
= π·(π©|π¨π)π·(π¨π) + π·(π©|π¨π)π·(π¨π) + β―+ π·(π©|π¨π)π·(π¨π)
= Οπ=ππ π·(π©|π¨π)π·(π¨π) β Total Probability β .
β’ π·(π¨π π© =π·(π¨πβ©π©)
π· π©=
π·(π©|π¨π)π·(π¨π)
Οπ=ππ π·(π©|π¨π)π·(π¨π)
, π = π, π, β¦ , π
Sheet (3) [Revision on Probability]
4. All tractors made by a company are produced on one of three assembly lines, named Red,
White, and Blue. The chances that a tractor will not start when it rolls off of a line are 6%,
11%, and 8% for lines Red, White, and Blue, respectively. 48% of the companyβs tractors
are made on the Red line and 31% are made on the Blue line.
(a) What fraction of the companyβs tractors do not start when they roll off of an assembly
line?
πΉ
π©
πΎ
Let:
Red Line: R, Blue Line: B, White Line: W
Not Start β Defective β: D
π π·= π π β© π· + π π΅ β© π· + π π β© π·= 0.0288 + 0.0248 + 0.0231= 0.0767 Γ 100= 7.67 β 8%
π«
π«
π«
π· π© = π. ππ
π· π«|πΉ = π. ππ
π· π«|π© = π. ππ
π· π«|πΎ = π. ππ
β©
π·(πΉ β© π«) = π·(π«|πΉ)π·(πΉ)= π. ππ Γ π. ππ= π. ππππ
π·(π© β© π«) = π·(π«|π©)π·(π©)= π. ππ Γ π. ππ= π. ππππ
π·(πΎβ©π«) = π·(π«|πΎ)π·(πΎ)= π. ππ Γ π. ππ= π. ππππ
(b) What is the probability that a tractor came from the red company given that it was
defective?
π· πΉ|π« =π· πΉ β© π«
π· π«
=π.ππππ
π.ππππ= π. ππππ
πΉ
π©
πΎ
π«
π«
π«
π· π© = π. ππ
π· π«|πΉ = π. ππ
π· π«|π© = π. ππ
π· π«|πΎ = π. ππ
β©
π·(πΉ β© π«) = π·(π«|πΉ)π·(πΉ)= π. ππ Γ π. ππ= π. ππππ
π·(π© β© π«) = π·(π«|π©)π·(π©)= π. ππ Γ π. ππ= π. ππππ
π·(πΎβ©π«) = π·(π«|πΎ)π·(πΎ)= π. ππ Γ π. ππ= π. ππππ
+
π· π« = π. ππππ
Sheet (3) [Revision on Probability]
2. A test for a rare disease claims that it will report a positive result for 99.5% of people with
the disease, and will report a negative result for 99.9% of those without the disease. We
know that the disease is present in the population at 1 in 100,000. Knowing this information,
what is the likelihood that an individual who tests positive will actually have the disease?
π«
π«β²
Let:
The person with the disease: D.
The person without the disease: Dβ².
+ππβ©
π·(π« β© +ππ) = π·(+ππ|π«)π·(π«)= π. πππ Γ π. πππππ= π. ππ Γ ππβπ
π·(π« β© βππ) = π·(βππ|π«)π·(π«)= π. πππ Γ π. πππππ= π Γ ππβπ
π·(π«β² β© +ππ) = π·(+ππ|π«β²)π·(π«β²)= π. πππ Γ π. πππππ= π. ππππ Γ ππβπ
βππ
βππ
+ππ
π·(π«β² β© βππ) = π·(βππ|π«β²)π·(π«β²)= π. πππ Γ πππππ= π. ππππππππ
Note that:π π΄|πΈ + π π΅|πΈ +β―+ π π πΈ= 1
what is the likelihood that an individual who tests positive will actually have the disease?
π· π«| + ππ =π· π« β© +ππ
π· +ππ=
π· π« β© +ππ
π· π« β© +ππ + π· π«β² β© +ππ
=π.ππΓππβπ
π.ππΓππβπ + π.ππππΓππβπ= π. ππππ Γ ππβπ = π. πππππππ
π«
π«β²
+ππβ©
π·(π« β© +ππ) = π·(+ππ|π«)π·(π«)= π. πππ Γ π. πππππ= π. ππ Γ ππβπ
π·(π« β© βππ) = π·(βππ|π«)π·(π«)= π. πππ Γ π. πππππ= π Γ ππβπ
π·(π«β² β© +ππ) = π·(+ππ|π«β²)π·(π«β²)= π. πππ Γ π. πππππ= π. ππππ Γ ππβπ
βππ
βππ
+ππ
π·(π«β² β© βππ) = π·(βππ|π«β²)π·(π«β²)= π. πππ Γ πππππ= π. ππππππππ