Skip to content

slope

Slope of a linear regression line.

v = slope(knownys, knownxs)

Returns the slope of the least-squares regression line through (x, y) points — the b1 coefficient in y = b0 + b1*x.

slope([2 4 6 8], [1 2 3 4]) % 2
  • intercept — Y-intercept of a linear regression line.
  • linest — Linear regression coefficients (with optional statistics).
  • rsq — Square of the Pearson correlation coefficient (R²).
  • trend — Linear-trend predictions.