Download presentation
Presentation is loading. Please wait.
1
Ch. 12 More about regression
Ch Transforming to Achieve Linearity Ch. 12 More about regression
2
L1 β Length L2 β Weight LinReg for L1 and L2 π€πππβπ‘ =β (πΏππππ‘β) π€πππβπ‘ =β = grams Look at the data, is this a good prediction? No
3
Resid (Obs β Exp): L4 β L2 β L3
Pred: L3 β β (L1) Res Resid (Obs β Exp): L4 β L2 β L3 Resid Plot: stat plot β L1 vs L4 Length curved not linear transform powers roots logarithms Weight is related to volume. weight = a β
(length)3 Volume is usually proportional to (length)3.
4
L3 β L1 3 stat plot β L3 vs L2 π€πππβπ‘ =4.07+.0147 πππππ‘β 3
Weight stat plot β L3 vs L2 (Length)3 π€πππβπ‘ = πππππ‘β 3 LinReg for L3 and L2
5
Much better prediction π€πππβπ‘ =4.07+.0147 24 3 =207.3 grams
π€πππβπ‘ = =207.3 grams π=.997 What does this mean? correlation coefficient Strong positive relationship for predicted weight and (length)3. Pred: L4 β (L3) Res Resid (Obs β Exp): L5 β L2 β L4 (Length)3 Resid Plot: stat plot β L3 vs L5 Random scatter = good!
6
Now use LinRegTTest to check each value
π€πππβπ‘ = πΏππππ‘β 3 use (length)3 list πβπ½ S E π = .0147β π π π₯ πβ1 π π₯ = 4.07 .563 always two-sided .0147 .00024 61.07 18.84 99.52% π‘cdf .59, 9999, 18 Γ2 πππ π π 2 πβ2 π 2 π‘cdf(61.07, 9999, 18)Γ2 Now use LinRegTTest to check each value
7
Same for ln (natural log)
Linear function. Already in linear form. Logarithmic function. Already in linear form. Exponential function. Power function. log π¦ = log (π π π₯ ) log π¦ = log (π π₯ π ) log π¦ = log π + log π π₯ log π¦ = log π + log π₯ π log π¦ = log π + π₯log π log π¦ = log π + πlog π₯ linear form linear form
8
Use your calculator and do LinReg for log π₯ and log π¦ lists
length weight log(L1) log(L2) π₯ π¦ logβ‘(π₯) logβ‘(π¦) no no no yes! power π¦=π π₯ π log π€πππβπ‘ =β log πππππ‘β Use your calculator and do LinReg for log π₯ and log π¦ lists Yes! Random scatter means thereβs a linear relationship. Pred: L5 β β (L3) Res Resid (Obs β Exp): L6 β L4 β L5 log(length) Resid Plot: stat plot β L3 vs L6
9
log π€πππβπ‘ =β1.899+3.04 log πππππ‘β
π€πππβπ‘ =0.0126β
πππππ‘β 3.04 π¦=π π₯ π weight LSRL On your calculator, put this equation into Y1 and graph it with the original scatterplot (π₯ vs π¦). length On the AP Exam, you donβt need to know the algebraic properties of logs. However, you should know how to use calculations to transform data using logs and how to make predictions using the LSRL.
10
π¦ =π+ππ₯ π¦ =2.3+4.1π₯ π₯ vs π¦ π¦ =π+ππππ π₯ π¦ =2.3+4.1πππ π₯ log(π₯) vs π¦
lnβ‘(π₯) π¦ =π+ππππ π₯ π¦ = πππ π₯ log(π₯) vs π¦ lnβ‘(π¦) π¦ =π π π₯ π¦ = π₯ π₯ vs log π¦ lnβ‘(π₯) lnβ‘(π¦) π¦ =π π₯ π π¦ =2.3 π₯ 4.1 log π₯ vs log π¦
11
However, this is the incorrect line of best fit.
L1 β X L2 β Y Nope! Looks exponential π‘ππππ =β (π¦ππππ ) π=0.669 However, this is the incorrect line of best fit. We need to transform the data.
12
Since we plot π₯ vs lnβ‘(π¦), we use the form ln π¦ =π+ππ₯.
Yes! ln(transistors) years since 1970 LinReg for L1 and LNY Since we plot π₯ vs lnβ‘(π¦), we use the form ln π¦ =π+ππ₯. lnβ‘( π‘ππππ ππ π‘πππ )= (π¦ππππ π ππππ 1970) π=0.994 much better!
13
lnβ‘( π‘ππππ ππ π‘πππ )=7.065+0.366(π¦ππππ π ππππ 1970)
2045β1970=75 lnβ‘( π‘ππππ ππ π‘πππ )=34.515 π lnβ‘( π‘ππππ ππ π‘πππ ) = π π‘ππππ ππ π‘πππ =9.77Γ 10 14 977 trillion What do we need to be careful about? Extrapolation!
14
Residual Plot (π vs resid): stat plot β L1 vs L4
π‘= πβπ½ S E π Constant 7.065 # yrs since 1970 0.366 34.91 5.14Γ 10 β15 0.544 98.86% π‘cdf(34.91, 9999, 14)Γ2 πππ π π 2 πβ2 π 2 Predicted values: L3 β (L1) Res Residuals (Obs β Exp): years since 1970 L4 β LNY β L3 Residual Plot (π vs resid): stat plot β L1 vs L4
15
Make a list called LOGY β log(L1)
Yes! Make a list called LOGY β log(L1) Plot L1 vs LOGY logβ‘β‘( π‘ππππ )= (π¦ππππ ) LinReg β L1 and LOGY logβ‘β‘( π‘ππππ ππ π‘πππ )= (π¦ππππ π ππππ 1970) logβ‘β‘( π‘ππππ ππ π‘πππ )= (75) logβ‘β‘( π‘ππππ ππ π‘πππ )=14.993 10 log π‘ππππ ππ π‘πππ = π‘ππππ ππ π‘πππ =9.84Γ 10 14 984 trillion Very close to the prediction when using natural log
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.