<< random_real Probas Stats relative_frequency >>

Scilab Scholar module for schools >> Probas Stats > regression_y_on_x

regression_y_on_x

line of regression by the method of least squares

Calling sequence

r = regression_y_on_x(x,y)

Arguments

x

vector of real numbers

y

vector of real numbers

r

vector of two real numbers

Description

regression_y_on_x(x,y) returns the vector of coefficients a and b of the regression line for y on x by the method of least squares, with linear equation Y=aX+b, where x and y are vectors of numbers with the same dimension and x is a vector of numbers not all equal.

Examples

x=[48,75,59,22,72]
y=[132,185,160,86,175]
regression_y_on_x(x,y)
<< random_real Probas Stats relative_frequency >>