Regression

advertisement
LINEAR REGRESSION CALCULATIONS
PURPOSE:
The purpose of this lab is to develop linear regression calculation techniques that you may draw upon later
in this course. You will conduct a simple experiment that produces bivariate data, then you will calculate
the necessary statistics to produce a least squares linear regression fit. We will later draw upon computer
resources to automate the procedure and provide confidence intervals and goodness of fit tests.
THEORY:
According to Hook’s law, the displacement of the end of a spring is directly proportional to the mass by the
spring constant k.
F = -k X
A plot of the force F (in N) versus the position X (in m) should give a line with slope negative k (in N/m)
passing through the origin with y-intercept zero. By plotting F and X data for a spring of unknown spring
constant k, we may determine the spring constant k by measuring the slope of our data line.
Least square linear regression techniques allow us to calculate the best fit line to our data, and thus the best
estimate for the spring constant value k (the slope of the line). Further, we may determine the +/- standard
deviation error of our determination through decomposition of sums of squares and similar methods.
DATA TABLE:
You should arrange your data in a neatly organized table as the experiment is being performed. Compute
the force that corresponds to the mass of the weights being suspended by the spring. Be sure to include
your +/- error estimates for each measurement. It may be appropriate to label an entire column of data as
having the same +/- error, but give it some thought first. Also, consider what columns you will need, and
leave room for the unexpected…
EXPERIMENT:
You will hang masses of various weights off the end of a spring that is mounted vertically against the wall.
Your bivariate data (ordered pairs) will consist of mass measurements and the corresponding deflection
distances as measured from some arbitrary point (say the mounting point of the spring). You should use at
least 10 different weights to produce 10 ordered pairs. Take special care to refine your measurement
technique as discussed in the laboratory.
PLOTTING YOUR DATA:
You should plot your data in your lab book by hand as the experiment is being performed. Be sure to give
some thought to the x and y axis scaling before you begin. Include error bars that correspond to the +/error values.
BEST FIT LINE:
Using your ruler, draw what appears to be the best-fit line to that of your bivariate data. Indicate the
equation of the line (slope intercept form).
ERROR CONSIDERATIONS:
Draw dotted lines which give the two extreme line fits as shown in lab, and indicate the equations of these
lines (slope intercept form).
LEAST SQUARES REGRESSION:
Use the supplied handout to prepare a table of summary statistics, and to calculate the least squares
regression line by hand. Also, compute the Decomposition of Sums of Squares SS(tot), SS(error), and
SS(reg), as well as the Coefficient of Determination (r-squared), and the Pearson’s Sample Correlation
Coefficient (r). Use the formulas at the bottom of the handout to determine the standard deviation errors
associated with the slope and y-intercept of your best-fit line. The Coefficient of Determination (r-squared)
is a measure of the goodness of fit. The Pearson’s Sample Correlation Coefficient (r) is a measure of linear
association. Be sure to pay careful attention to the slope of your line and how that effects the value of r. In
next week’s lab, we will discuss the meaning of some of the other statistics.
CONGRATULATIONS:
You are now a statistical wizzz. I hope you will draw upon these newly developed skills to enhance your
lab-work in this class in the future. Keep in mind that the idea is to enhance your data presentation and
laboratory write-up skills in preparation for the formal laboratory write-up later this semester. The grading
standards will be high, and we will expect you to determine regression slopes and compute the standard
error of your regression slope parameters for all labs involving the determination of a best-fit line. Good
thing we will be learning how to do all this on the computer.
GENERAL LAB BOOK PROTOCAL:
Be sure to save the first two pages of your lab book for a table of contents to be added later.
Be sure to give each lab a “cover page” by devoting an entire page of the laboratory write-up to the title of
that week’s experiment, your name, your lab partners name, the date the experiment was performed, and an
abstract to be added later.
Download