# Linear Regression

A classic statistical problem is to try to determine the relationship between a random
variable Y. and an independent variable x. For example, we might consider height and weight of a sample of adults.
Linear regression attempts to explain this relationship by fitting a curve to the data.
The linear regression model postulates that

Y= b0+b1 x1+ ... +bnxn+ e,
where the xi are independent variables and the "residual" e is a random variable with mean zero. In this applet, we consider the simplest example of fitting a straight line:

Y= a+bx+e.
The coefficients a and b are determined by the condition that the sum of the square residuals is as small as possible.

### The applet:

This applets let you mark the locations of order pairs  (x, Y), on the left screen and then determines the equation
of the regression line and graphs it. The applet will also show confidence bands for means of y corresponding to a given x, and prediction bands for future values of y corresponding to a given value x.

### References:

Regression is discussed in most introductory statistics texts.

## Source Code

This applet uses the Danby package in additon to the following java files:
This applet was written by Charles Stanton