This applet allows the user to generate bivariate data for analysis with simple linear regression.
The data are generated using the following model:
whereis the intercept (default = 0), is the slope (default = 1), and are normal errors with mean 0 and standard deviation 3.
The user is allowed to change the values of the intercept and the slope but not the standard deviation of the errors.
Pressing the "Line On" button adds the line
and the sum of squared errors (residuals) is computed defined by
If the "Add Residuals" box is clicked the residuals defined by
are drawn, connecting the observations to the user line.
Using the arrows in the lower right corner the user may then move and rotate the line to try to find the best fit to the data.
This is accomplished by making the length of the residuals as small as possible.
Such a line will minimize (1).
Pressing the "Regression Line On" adds a regression line that minimizes the (1).
The regression line uses the following estimates to fit the line:
See also: Correlation.