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~~CalledByGraph proc~linear_regression Linear_Regression proc~best_linear_regression Best_Linear_Regression proc~best_linear_regression->proc~linear_regression proc~difference_mw_plus difference_mw_plus proc~difference_mw_plus->proc~best_linear_regression proc~get_c_or_m_plus get_c_or_m_plus proc~get_c_or_m_plus->proc~difference_mw_plus proc~characterize characterize proc~characterize->proc~get_c_or_m_plus

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