Correlation Coefficient Calculation Module

Category:
Dates and Math
Type:
Modules
Difficulty:
Intermediate
Author:
Peter Wester

Version Compatibility: Visual Basic 6

More information:
'Syntax:
'CorrelationCoefficient(RawData, column X, Column Y, code for weightfactor
'
' weightfactor 0: equal
'              1: 1/x
'              2: 1/x^2
'              3: 1/y
'              4: 1/y^2

'To be called:
'
'r=CorrelationCoefficient(RawData)
'
'calculates the correlation coefficient from RawData(n,0) against RawData(n,1)
'with equal weightfactors

'r=CorrelationCoefficient(RawData, 1, 3, 4)

'calculates the correlation coefficient from RawData(n,1) against RawData(n,3)
'with 1/y^2 as weightfactors
A Word document explaining the math behind correlation coefficients, is 'part of the package'.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download corcoef.zip