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
 Origin Forum
 how to write my own function for statistics?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bryansheng

China
Posts

Posted - 03/19/2005 :  10:43:29 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 7.0(Select Help-->About Origin):
Operating System:win2000
It is known that statistics on column button can give you expected result.But i want to calculate other statistics not included in origin.How can i write my own function for my purpose.In addition,how to add the function in the origin?

easwar

USA
1965 Posts

Posted - 03/19/2005 :  2:34:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use Origin C to write your own functions for any custom analysis. Origin C provides access to all Origin objects such as worksheets, graphs etc. See the following page for some examples:
http://www.originlab.com/index.aspx?s=9&lm=71&pid=268

Also note that you can access the NAG library from Origin C and this library has many statistics functions.

Once a function has been coded in Origin C, it can be called from the script window, or it can be called from a user-defined button etc.

If you have specific questions on Origin C, please post in the Origin C forum.

Easwar
OriginLab

Go to Top of Page

bryansheng

China
Posts

Posted - 03/19/2005 :  9:18:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!
But can i add user-defined button onto the shortcut menu? For example,if i choose a column of data and right-click it,then a shortcut menu pops.A Statistics on columns button is included.If clicking it,many statistics value is calculated.So i want to know whether i can add something on the function of the button in order to make user-defined function as a system default function.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 03/20/2005 :  07:30:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The context menus are not programmable but you can program the regular menu bar menus. You could also create a toolbar button for the task.

Mike Buess
Origin WebRing Member
Go to Top of Page

easwar

USA
1965 Posts

Posted - 03/20/2005 :  2:05:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:

So i want to know whether i can add something on the function of the button in order to make user-defined function as a system default function.



Hi,

What that menu item and the buttons do is to call a specific section of a specific script (.OGS) file. If you open the script window and hold the CTRL and Shift key down while you execute that context menu or click on the button, you will see in the script window:
run.section(WKS,DescStats)

So you could then open the WKS.ogs file found in the EXE path of the Origin installation, go to the DescStats section of that file, and add additional script code which in turn can call a custom Origin C function. This way you could change the default behaviour.

Can you share with us what additional statistics you are looking for, so that we can consider adding that in a future version?

Easwar
OriginLab



Edited by - easwar on 03/20/2005 2:05:37 PM
Go to Top of Page

bryansheng

China
Posts

Posted - 03/22/2005 :  9:19:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks!I see.
I want to calculate the fairness index of a dataset.It is defined as:
FI=square(sum(xi))/sum(square(xi)),where 0<FI<=1.If FI approaches 1,it means fair.
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