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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 masking data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ovince

Yugoslavia
Posts

Posted - 05/08/2006 :  7:18:17 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
hi everybody,

when plotting a dataset I see 4 data that I would like to exclude
from analysis. I would like to do it using Origin C or LabTalk. How to do it?

thanks
oliver

Mike Buess

USA
3037 Posts

Posted - 05/08/2006 :  8:59:32 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi oliver,

You can mask/unmask point (row) i in a dataset with the LabTalk command dataset<i>=n, where n=1 (mask) or 0 (unmask).

Mike Buess
Origin WebRing Member
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 05/09/2006 :  02:08:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanks Mike...it works

oliver
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 05/09/2006 :  02:29:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi,

I have masked 4 data in Origin C by typing:

LT_set_str("%R", nameForLT); //nameForLT is the dataset name
LT_execute("%R<16>=1");
LT_execute("%R<466>=1");
LT_execute("%R<1089>=1");
LT_execute("%R<1561>=1");

I tought it works because the bad data were colored into red. But comparing analysis with masked and unmasked data (correlation coefficient and standard deviation) one can notice that the data were NOT really excluded from analysis. What whould be the next step?

oliver
Go to Top of Page

larry_lan

China
Posts

Posted - 05/09/2006 :  07:54:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oliver:

If you want to do linear fitting, you can use the stat.lr() command, lr dataset command will not exclude the masked data.

stat.dataset$=datasetname;
stat.lr();
stat.r=;
stat.sd=;

Then you can get the proper correlation coefficient and standard deviation.

Larry
OriginLab GZ Office
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 05/10/2006 :  04:44:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Do you know how to include these commands

stat.dataset$=datasetname;
stat.lr();
stat.r=;
stat.sd=;

into Orugin C? I have tryed with LT_execute() but does not work

oliver
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 05/10/2006 :  05:12:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi,

fals alarm...it works with LT_execute? If the data is plotted in an active graph window, lr adds the data plot of the fitted curve to the graph window. This is not the case with stat. What to do?
oliver
Go to Top of Page

larry_lan

China
Posts

Posted - 05/10/2006 :  05:34:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Olive:

Sorry, it should be

stat.data$=datasetname;

to specify a dataset.

If you using OriginC, maybe you can use fitpoly() function to do the fitting directly. like:

void test()
{
Curve crv("Data1_A","Data1_B");
double coeff[2];
fitpoly(crv, 1, &coeff);
}


Edited by - larry_lan on 05/10/2006 05:41:06 AM
Go to Top of Page

ovince

Yugoslavia
Posts

Posted - 05/10/2006 :  05:51:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hi,

What I am trying to do is to analyse a large number of data sets.

1. For each data set I should calculate Coeff of Linear Correlation and Standard Deviation.

2. The data should be plotted together with the fitted curve in order to analise it by eye.

3. If the fit is not good to remove some data.

For this task I have used lr.r and lr.stat because it automaticaly plots the fitted curve.

With stat feature and fitpoly I cannot find how to do it. Could you help me?


oliver
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 05/10/2006 :  08:38:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Oliver,

This shows how to create a fit curve with the stat object...

stat.reset();
stat.data$=dataset name;
stat.fitxdata$=wks_Xname; // X dataset for fit curve (column must already exist)
stat.fitydata$=wks_Yname; // Y dataset for fit curve (column must already exist)
stat.makeX.fitnpts=fit_points; // number of points in fit curve
stat.makeX.fitX1=lower_limit; // lowest X-value on fit curve
stat.makeX.fitX2=upper_limit; // highest X-value on fit curve
stat.makeX(); // create X values for fit curve
stat.lr(); // perform fit and create Y values
%A=stat.fitydata$;
lay -i200 %A; // plot fit curve in active graph layer

You can also use the nlsf object which will obtain the parameters you want (and many more), supports masking and can draw the fit curve.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/10/2006 10:00:15 AM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000