Math 151 , Fall 2005, Day 15 Wed. Sept. 28 Hit reload  Corrections

Exams still not finished.
Re)Reading   D&V Ch7 Scatterplots, first thru 117 (AS7-1&2), then Correlation, the rest. (AS7-3&4) You do not have to be able to calculate r by hand.  You should be able to guess roughly at an r for a swarm of data.    Read Ch8, AS8 Regression
Hand in Wed.
Regression Prep  (Review graphing straight lines if needed--Math clinic)

A. Open the Excel file RegressionSlope (or in the folder RegressionDemosExcel for D&V in ClassMaterial\Math151 D&V).  Change x-y values in the yellow boxes and watch the line change.  Change x-values in col. F and watch the "run" (red line) change, in the rightmost 2 graphs. Notice the slope = the coefficient of x = the rise/run = increase in y per unit increase in x.  Fix it so the increase in x (the "run") is exactly 1.   Also, look at the leftmost graph, where the length of the standard deviations are shown, and note that in standard-deviation units, the rise is r s.d.s in y for each s.d. run in x. Print the page  to hand in.

B. Practice fitting lines:  Use the Moore website www.whfreeman.com/ips("Do this" below) and try to fit at least 4 different data sets. Write down on your paper what you discovered (were your judgment errors consistent in any ways--did you have any surprises?) 

SPSS Handout: Do problems 7, 8, 9, 11 p. 3.  Keep this with the previous work. 

(All D&V p. 153ff unless otherwise noted)

21(SPSS) a,b,c &23a,b,c,d Used cars   Keep a copy of your equation. #21/23The SPSS data file is missing a value! age 4, price 6995 has been omitted.This gives price = 12519.62 - 940.04*age, R-square = .91 When the missing value is restored, we get price = 12319.59 - 924.0 * age, R-square = .89 The graphs don't look much different.
36 a thru d Gators  (See p. 149 for how to read  results)

------ Residuals-----
23 e, f  Used cars, residuals
9 Real estate (I think it should be "-6000" in part c) 
24 Veggie burger 
17, 26 Should not have been assigned Day 15
17 SAT scores
26 Chicken (y = calories, x = fat)  a thru f only. 

Read,
to discuss 
Optional
If you feel at all shaky about
graphing or using straight lines
(slopes, intercepts) be sure to
do Linear Equations exercise
 and Line Equations, 
Activstats 8-1, activities 3&4
(in preparation for Ch.8)
Wed Day 15:  Homework questions??? What did you see in your circle data?  Day 14
Corn planting problem:  Predict or estimate a yield (response)  for each  level of seed planted (explanatory).  Use mean for each prediction.

Regression line: D&V Ch 8&9, AS8&9, A model that Predicts or estimates a y (vertical) value for a given x (horizontal) value: Straight line!   "Regressing y ON x"
    Formula yhat =  b0 + b1 x,   yhat = a + b x,  weight = -70 +3 height.  (inches, pounds)
         To predict a y-value for a given x-value, plug the x value into the formula and calculate. 60 inches-->110 lb
                To do it graphically, use the "Up-and-Over" method .
                    Find the x, go straight up to the line, then go over to the y-axis; that y-value is the predicted y.

        b0 or a or -70 is y-intercept.
        b1 or b  or 3 is slope (b1 multiplies x, the horizontal value):
                 If x increases one unit, yhat increases b1 units.
                      For every inch of height, the model predicts 3 pounds increase in weight.
    RegressionSlope.xls   (or in the folder RegressionDemosExcel for D&V in ClassMaterial\Math151 D&V)

We all get the same line from a batch of data because we use the "least-squares best fit" criterion. (How we get the line by hand, later.)
We are trying to find an "average" (mean) y value for each x value, with the constraint that they all lie on a straight line.
Do this: Practice fitting "least squares best fit" lines:  Moore's website,  http://www.whfreeman.com/scc,  or http://www.whfreeman.com/ips)
  Choose "Statistical Applets",  Correlation/Regression Demo.  Check in the "Show least-squares line" box and put in some data points.   Check in the "Show Mean X &Mean Y lines" box; note that line always goes thru their crossing.  Repeat for a few data sets.
--Try fitting the line yourself:  (Uncheck the "Show ..." boxes.) Put in some data points.  Now click Draw Line.  Click and drag in the picture and you'll get a line with 3 blobs. Drag the center and it will go up and down, Drag an end and the slope will change. Put the line in the best place for predicting y's from x's.  If you do well by the "least squares" criterion, the green bar up top will shrink close to 0 (but  you have to be really good.  Dumb.)   Check in the "Show Mean X &Mean Y lines" box; adjust your line.  Check in the "Show least-squares line" box and see how you did.

SPSS:  will fit a regression line to data (back page of handout).  While  Editing graph, Insert>Fit line>Regression.
Get line, Equation of line and R2 (the square of the correlation coefficient).  Govsal on avgpay
For Govsal vs. avpay:   Govsal = 28,569.69 + 2.71*avgpay    (Predicted Governer's salary  increases  $2.71 for every dollar increase in a state's average pay.)

Residual:  Look at an individual observed (x,y) data pair.  The residual is the "leftover" amount of y after predicting a y using the line.  Visually, length of vertical line drawn from y to regression line (+ if point is above line, -  if point is below line)
   Residual = observed - predicted = Data - Model   e = y -yhat.
         Govsal = 28,569.69 + 2.71*avgpay
  Visually, SPSS (handout, p. 3, bottom:  In Edit mode, Insert>Spikes: Spike to: Regression)
     Calculating:  Montana (17895, 55502)   Govsal = 28,569.69 + 2.71*avgpay
           Predicted Govsal = 28,569.69 + 2.71*17895 = 28,569.69 + 48495.45 = 77065.14
           Residual = 55,502 - 77065 =  -21563,  $21,563 below expected value.




Sievers home  Math151-Fall05/Dayf15.htm  11pm 9/27/05
This page belongs to Sally Sievers who is solely responsible for its content. Please see our statement of responsibility.