Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regression Analysis in Foxpro
Message
From
02/05/2005 23:32:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
02/05/2005 07:38:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01010100
Message ID:
01010379
Views:
25
>I'm looking for a subroutine that will perform a regression analysis on data in a Foxpro table. Anyone have any suggestions of where to look? Thanks...

The "best fit" is defined as the line where the squares of the distances of the individual data points, from the resulting line, is at a minimum.

Excel help, for the corresponding functions, explains how Excel does the calculation.

Basically, it seems that for a single independent variable, x, the slope m would be:
    sum((x - xx)(y - yy))
m = --------------------------
       sum((x-xx)^2)
and the intersect, b:
b = yy - m*xx
Where I used xx and yy for the average values of x and y. If I understand correctly, the two sums must be done separately, adding the formula result for all the data points.

HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform