| 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 |
|
|