A straight line through two columns
Two text areas hold the X and Y data, each hinting at one number per line, so the row counts must correspond. The tool fits a line by least squares and reports slope, intercept and correlation. Controls compute, load a sample, clear and copy. Regression describes trends and supports rough prediction, but correlation is never causation.
Steps
- Paste the independent variable into X and the dependent into Y, one per line.
- Confirm equal row counts, since one misplaced value ruins everything.
- Load the sample to see the output fields and the units of slope and intercept.
- Compute and read the slope, intercept and coefficient of determination.
- Judge fit: a coefficient near one fits well, near zero means almost no linear relation.
- Copy the result, clearing both areas before new data.
What least squares does
Least squares finds the line minimising the sum of squared vertical distances from points. The slope states how much Y changes per unit of X, while the intercept is the prediction at X of zero, often meaningless in practice. The coefficient of determination is the share of variation explained, one meaning every point lies on the line and one half meaning half explained. A single extreme point visibly rotates the slope, an effect statisticians call influence, so plot the data before trusting it. With only a handful of points the fit is unstable and changes with one more observation.
Common mistakes
Unequal row counts that misalign data. Reading regression as causation. Ignoring units and misreading the slope. Interpreting the intercept where X cannot be zero. Skipping outlier checks. And drawing trend conclusions from tiny samples.
Where a line is the wrong model
Clearly non-linear relations need curve fitting. Confounders need multiple regression. Causal claims need experiments or dedicated designs. And a fitted line carries an error band that predictions ignore at their peril.