Linear Regression

A classic statistical problem is to try to determine the relationship between two random
variables  X and Y. For example, we might consider height and weight of a sample of adults.
Linear regression attempts to explain this relationship with a straight line fit to the data.
The linear regression model postulates that

Y= a+bX+e
Where the "residual" e is a random variable with mean zero.  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), and then determines the equation
of the regression line and graphs it.


The source code: RegressionApplet.java
RegressionCanvas.java
RegressionControlPanel.java
PlotPoint.java
ResidualCanvas.java
Xcanvas.java

Back to the Java applets page