The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 R-squared

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ovince 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
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess 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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000