File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
Username:
Password:
Save Password
Forgot your Password?
|
Admin Options
All Forums
Origin Forum for Programming
Forum for Origin C
R-squared
New Topic
Reply to Topic
Printer Friendly
Author
Topic
ovince
Yugoslavia
Posts
Posted - 11/26/2006 : 06:24:51 AM
hi,
Could someboby help me to complete this statistical task.
I have a worksheet with X , Y data. I would like to fit polynoms (1 oreder, 2 order ...) to the data and to calculate the corresponding R-squared.
I have something like this:
void test()
{
...
//calculate R-square
string strB1 = "Data1_B"
LT_set_str("%P", strB1);
string LTcmdB1;
LTcmdB1 = "stat.data$=%P;"
"stat.lr();";
LT_execute(LTcmdB1);
double adrsqCB1;
LT_get_var("stat.adrsq", &adrsqCB1);
.....
}
how to 'tell' the program to calculate R-squared for 3 order polynom for example? Or for 2 order?
Thanks
oliver
Mike Buess
USA
3037 Posts
Posted - 11/26/2006 : 2:44:44 PM
Hi Oliver,
R^2 is given by
stat.cod
but polynomial fit is
stat.pr()
, not
stat.lr()
(linear regression).
using stat = LabTalk.stat;
stat.reset();
stat.data$ = "Data1_B";
stat.pr.order = 1; // 1st order
stat.pr();
out_double("1st order: R^2=",stat.cod);
stat.pr.order = 2; // 2nd order
stat.pr();
out_double("2nd order: R^2=",stat.cod);
Mike Buess
Origin WebRing
Member
Edited by - Mike Buess on 11/26/2006 2:46:01 PM
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Forum
Origin Viewer Forum
Origin Learning Edition Forum
Origin Forum for Programming
Forum for Python
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
LabTalk Forum
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000