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
 Origin Forum
 how to write my own function for statistics?

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
bryansheng Posted - 03/19/2005 : 10:43:29 AM
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?
5   L A T E S T    R E P L I E S    (Newest First)
bryansheng Posted - 03/22/2005 : 9:19:51 PM
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.
easwar Posted - 03/20/2005 : 2:05:07 PM
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
Mike Buess Posted - 03/20/2005 : 07:30:56 AM
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
bryansheng Posted - 03/19/2005 : 9:18:42 PM
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.
easwar Posted - 03/19/2005 : 2:34:14 PM
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


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