Linear_Regression Subroutine

public subroutine Linear_Regression(x, y, a, b, r2)

This subroutine computes the regression line for a data set of x, y variables.

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: x(:)

x: input array of length n which contains the set of independent variable

real(kind=pr), intent(in) :: y(:)

y: input array of length n which contains the set of dependent variable

real(kind=pr), intent(out) :: a

a: output real variable. Slope of the regression line

real(kind=pr), intent(out) :: b

b: output real variable. Intercept of the regression line

real(kind=pr), intent(out) :: r2

Called by

proc~~linear_regression~3~~CalledByGraph proc~linear_regression~3 Linear_Regression proc~best_linear_regression~3 Best_Linear_Regression proc~best_linear_regression~3->proc~linear_regression~3 proc~difference_mw_plus~2 difference_mw_plus proc~difference_mw_plus~2->proc~best_linear_regression~3 proc~get_c_or_m_plus get_C_or_m_plus proc~get_c_or_m_plus->proc~difference_mw_plus~2

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: aux1
real(kind=pr), public :: aux2
real(kind=pr), public :: aux3
real(kind=pr), public :: aux4
real(kind=pr), public :: aux5
integer, public :: i
integer, public :: n

total number of data set.

real(kind=pr), public :: t1
real(kind=pr), public :: t2
real(kind=pr), public :: t3
real(kind=pr), public :: t4