Stat 101L: Lecture 16 Goal 3 – Straighten Up What is the relationship between the temperature of coffee and the time since it was poured? –Y, temperature ( oF) –X, time (minutes) 1 Bivariate Fit of Temp By Time (min) 200 190 180 170 Temp 160 150 140 130 120 110 100 90 80 0 10 20 30 40 50 60 Time (min) 2 Cooling Coffee There is a general negative association – as time since the coffee was poured increases the temperature of the coffee decreases. 3 1 Stat 101L: Lecture 16 Linear Model 190 180 Temp (F) 170 160 150 140 130 120 110 100 -10 0 10 20 30 40 50 60 Time (min) 4 Linear Model Fit Summary – Predicted Temp = 176.7 – 1.56*Time – On average, temperature decreases 1.56 oF per minute. – R2 = 0.99, 99% of the variation in temperature is explained by the linear relationship with time. 5 Plot of Residuals 5 4 3 Residual 2 1 0 -1 -2 -3 -4 -5 -10 0 10 20 30 40 50 60 Time (min) 6 2 Stat 101L: Lecture 16 Curved Pattern There is a clear pattern in the plot of residuals versus time. –Under predict, over predict, under predict. The linear fit is very good, but we can do better. 7 Bivariate Fit of Log(Temp) By Time (min) 5.5 5.4 5.3 Log(Temp) 5.2 5.1 5 4.9 4.8 4.7 4.6 4.5 -10 0 10 20 30 40 50 60 Time (min) Linear Fit 8 Log(Temp) by Time Summary – Predicted Log(Temp) = 5.1946 – 0.0114*Time –On average, log temperature decreases 0.0114 log(oF) per minute. 9 3 Stat 101L: Lecture 16 Plot of Residuals 0.010 Residual 0.005 0.000 -0.005 -0.010 -10 0 10 20 30 40 50 60 Time (min) 10 Interpretation There is a random scatter of points around the zero line. The linear model relating Log(Temp) to Time is the best we can do. 11 Original Scale? Predicted Log(Temp) = 5.1946 – 0.0114*Time Predicted Temp = 180.3*e–0.0114*Time – Predicted temp at time=0, 180.3 oF – The predicted temp in one more minute is the predicted temp now multiplied by e–0.0114 = 0.98866 12 4 Stat 101L: Lecture 16 JMP Method 1 –Create a new column in JMP, Log(Temp): Cols – Formula – Transcendental – Log. 13 JMP Method 1 (continued) –Fit Y by X Y – Log(Temp) X – Time –Fit Linear 14 JMP Method 2 –Fit Y by X Y – Temp X – Time –Fit Special Transform Y – Log 15 5