Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Equivalent of Excel LOGEST() Function?
Message
From
24/11/2001 02:44:53
 
 
To
23/11/2001 07:03:45
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00584819
Message ID:
00585336
Views:
39
>>Hmmm... an interesting approach, but I'm not sure they are mathematically equivalent.
>
>Not having used regressions in practice, I am not sure either. But in general, lots of things can be done converting back and forth, similar to the way I explained.
>
>Perhaps you can do a test in Excel, where, I believe, all required functions are available, and see whether you get identical results.

Well, although it was a good idea it's easy to show your original idea wouldn't work in this case. The data sets contain some negative y-values for which you can't get a logarithm.

It turns out the client really wants to duplicate the Excel logarithmic "trendline" function. In VFP parlance it calculates, using a least-squares method, the best-fit function
y = (m * LOG(x)) + b
I dug into my old university calculus texts and derived the equations for multiplier m and constant b. It turns out they are very similar to those for the least-squares fit for a line but it took quite a bit of work to convince myself it was correct!

In Excel it is possible, once you have put a logarithmic trendline on a chart, to display the equation Excel has calculated. It was gratifying to see that my solution gives exactly the same answers as Excel on the same test data sets.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform