Fit a straight line
- Input
- Pairs: (1,2), (2,4), (3,5), (4,8), (5,10).
- Method
- Estimate slope and intercept by ordinary least squares.
- Formula
- b1 = Sxy / Sxx; b0 = ybar - b1*xbar
- Intermediate steps
- Compute xbar and ybar
- Compute Sxy and Sxx from centered values
- Final result
- The fitted line has a positive slope and a positive R squared.
- Interpretation
- The slope estimates average change in y per one-unit increase in x within the observed range.
- Limitation
- Extrapolation beyond the observed x range can be misleading.