How it works
An ordinary least-squares slope with intercept is obtained from sample size and paired x/y summary sums. This form solves for regression slope; enter the known quantities in Paired sample size, Sum of x, Sum of y, Sum of squared x, Sum of x y products.
Inputs and units
| Input | Example value | What to enter |
|---|---|---|
| Paired sample size | 4 | Formula symbol: n. Enter a numeric value. Use a whole number. Must be greater than zero. |
| Sum of x | 10 | Formula symbol: sx. Enter a numeric value. |
| Sum of y | 20 | Formula symbol: sy. Enter a numeric value. |
| Sum of squared x | 30 | Formula symbol: sxx. Enter a numeric value. Use a non-negative value. |
| Sum of x y products | 60 | Formula symbol: sxy. Enter a numeric value. |
Worked example
Show example inputs and results
This example is generated by the same calculation engine using the starting values in the form. Your own inputs produce your own result.
- Paired sample size
- 4
- Sum of x
- 10
- Sum of y
- 20
- Sum of squared x
- 30
- Sum of x y products
- 60
Complete example results
- Regression slope
- 2
Reading the result
The result solves for regression slope from the entered quantities. Check the result unit and the formula conditions before using it.
Questions and answers
Can I use the example values for my own calculation?
The example values illustrate the calculation. Replace every input with your own information, especially dates, rates and the selected operation.
When can I use the regression slope result?
All sums need the same paired observations and positive x spread. This solves the slope relation, without raw-data validation, prediction intervals or causal claims.
Why are some results rounded?
Results display up to 8 decimal places. Calculations use the unrounded values; very small values use scientific notation. JavaScript floating-point arithmetic can introduce tiny rounding differences.
Are my inputs sent to a server?
The calculator processes inputs in your browser. Its code does not send your values to a server.
Method sources: itl.nist.gov