
Title: Graphs
Purpose: To learn to read data from a graph and get the regression line for a set of data points.
Theory:The slope of a straight line is defined by the following:
m(slope)= (y2-y1)/(x2-x1) where the coordinates of the two points on the line are:
(x2,y2) and (x1,y1).
The y-intercept (b) is the point on the y-axis where the line crosses. In general, the equation
for a straight line is: y = mx + b
The power law is: y = Axn where A and n are constants.If one takes the log of both sides,
one gets: log y = nlog x + log A
This equation is linear if one considers y to equal log y, x to equal log x, n to equal
the slope,and log A to equal the y-intercept.
The regression line is the straight line that fits a set of data points the best according
to the least-squares criterion.(sum of squared errors is smallest)
To see what this means,let columns x and y be a set of data points and column y(pred)
be the y from the regression line y(pred)=b1x + bo. See the table below:
| x | y | y(pred) | e2 |
| x1 | y1 | y1(pred) | (y1-y1(pred))2 |
| x2 | y2 | y2(pred) | (y2-y2(pred))2 |
| x3 | y3 | y3(pred) | (y3-y3(pred))2 |
| - | - | -- | ---- |
| Sum |
The least-squares criterion makes the sum of the squares of the errors (last column)
a minimum.
Procedure:
A(First Graph)
1. Scroll down to the first graph ( left window) and copy down the coordinates of two
points from the graph.
2.
Y2=
X2=
Y1=
X1=
3. Click start and follow the directions.
4. Copy down the slope and the y-intercept.
m=
b=
B(Second Graph)
1. Scroll down to the second graph and copy down the coordinates of two points from the
graph.
2.
Log Y2=
Log X2=
Log Y1=
Log X1=
3. Click start and follow the directions
4. Copy down A and n
A=
n=
C(Regression Line)
Given the following table of data:
1. From the first table of data, get the regression line and y(pred) by clicking start and
following the instructions
2. Plot y vs. x on cartesian graph paper(do not connect the points)
3. Plot y(pred) vs. x on the same graph paper(connect the points )
4.Are your points scattered about the regression line?
5. Repeat steps 1-4 for the second table of data
| x | y | x | y |
| 1 | 4 | 12 | 36 |
| 2 | 10 | 13 | 44 |
| 5 | 14 | 14 | 47 |
| 8 | 22 | 15 | 46 |
| 9 | 27 | 20 | 59 |
| x | y | x | y |
| 1 | 1 | 2 | -1 |
| 5 | -4 | 6 | -10 |
| 7 | -9 | 10 | -15 |
| 12 | -22 | 14 | -21 |
| 15 | -26 | 20 | -33 |
What to hand in!!!
1. From part A,slope (m) and y-intercept (b)
2. From part B, A and n
3. From part C, the two graph papers with the regression line printed on back
of each