Linear and Parabolic Regression Example 8.2
Chapter 8 Linear and Parabolic Regression Example 8.2
Repeat Example 8.1 using Excel’s Add Trendline feature.
Solution:
We first enter the given data in columns A and B as shown on the spreadsheet of Figure 8.4.
x( 0 C) y( Ω)
Straight line for Example 8.2
0 27.6 s ) 10 60 31.0
m 20 34.0 h O 50 30 37.0 ce ( 40 40.0 n 40 a 50 42.6 ist s 30 e 60 45.5 R 20
90 Temperature (degrees Celsius) 54.0
Figure 8.4. Plot of the straight line for Example 8.2
To produce the plot of Figure 8.4, we perform the following steps:
1. We click on the Chart Wizard icon. The displayed chart types appear on the Standard Types tab. We click on XY (Scatter) Type. On the Chart sub-types options, we click on the top (scat- ter) sub-type . Then, we click on Next>Next> Next>Finish, and we observe that the plot appears next to the data. We click on the Series 1 block inside the Chart box, and we press the Delete key to delete it.
2. To change the plot area from gray to white, we choose Plot Area from the taskbar below the main taskbar, we click on the small (with the hand) box, on the Patterns tab we click on the white box (below the selected gray box), and we click on OK. We observe now that the plot area is white. Next, we click anywhere on the perimeter of the Chart area, and observe six square handles (small black squares) around it. We click on Chart on the main taskbar, and on the Gridlines tab. Under the Value (Y) axis, we click on the Major gridlines box to deselect it.
3. We click on the Titles tab, and on the Chart title box, we type Straight line for Example 8.2, on the Value X-axis, we type Temperature (degrees Celsius), and on the Value Y-axis, we type Resis- tance (Ohms) . We click anywhere on the x-axis to select it, and we click on the small (with the hand) box. We click on the Scale tab, we change the maximum value from 150 to 100, and we click OK. We click anywhere on the y-axis to select it, and we click on the small (with the hand) box. We click on the Scale tab, we change the minimum value from 0 to 20, we change the Major Unit to 10, and we click on OK.
8 − 6 Numerical Analysis Using MATLAB ® and Excel ® , Third Edition Copyright © Orchard Publications
Parabolic Regression
4. To make the plot more presentable, we click anywhere on the perimeter of the Chart area, and we observe the six handles around it. We place the cursor near the center handle of the upper side of the graph, and when the two-directional arrow appears, we move it upwards by moving the mouse in that direction. We can also stretch (or shrink) the height of the Chart area by placing the cursor near the center handle of the lower side of the graph, and move it down- wards with the mouse. Similarly, we can stretch or shrink the width of the plot to the left or to the right, by placing the cursor near the center handle of the left or right side of the Chart area.
5. We click anywhere on the perimeter of the Chart area to select it, and we click on Chart above the main taskbar. On the pull-down menu, we click on Add Trendline. On the Type tab, we click on the first (Linear), and we click on OK. We now observe that the points on the plot have been connected by a straight line.
We can also use Excel to compute and display the equation of the straight line. This feature will
be illustrated in Example 8.4. The Data Analysis Toolpack in Excel includes the Regression Analysis tool which performs linear regression using the least squares method. It provides a wealth of infor- mation for statisticians, and contains several terms used in probability and statistics.