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
 Median (and other simple Stats) at Origin C

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
eulez Posted - 07/28/2004 : 11:50:26 AM
Hi!

I am beginning with Origin C. I am trying to obtain the "median" value of a Dataset, but I do not know how I could do it.

I get "maximum", "minimum" through ds.max (where ds is a Dataset object) and "mean" with the use of BasicStats and Data_sum.

However I do not find anything about "median" or the other stats from "Statistics On Columns".

I would feel very pleased if anyone could help me. Thank you.
4   L A T E S T    R E P L I E S    (Newest First)
Gary Lane Posted - 07/30/2004 : 12:16:48 PM
Hi,

Mike got it right for median in Origin v7.5....also:

double se = bsStat.sd/sqrt(bsStat.N);

OC in Origin v8 will have much more robust Statistics capabilities.

Gary

Mike Buess Posted - 07/28/2004 : 12:50:09 PM
Sorry, I misread your post. You can find the median with Data_percentiles...

Dataset dsA( "Data1_A" );
double dPercent = 50, dPercentile;
Data_percentiles( &dsA, &dPercent, &dPercentile, 1 );
printf( "The 50th percentile is %g\n", dPercentile );

There's a shortcut function called y50 that will also work...

Dataset dsA("Data1_A");
double dP50 = y50(dsA);
printf("50th Percentile of Data1_A is %g", dP50);

Also, see the Median Filtering add-on at the File Exchange...
http://www.originlab.com/FileExchange/details.aspx?C=5&cid=18&fid=83

Not sure about se.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/28/2004 1:07:36 PM
eulez Posted - 07/28/2004 : 12:21:40 PM
Well, that's right, I used this example for "mean" and "sd". But I said that I need "MEDIAN", and "SE", and all the calculation from "Statistics on Columns". I saw at the data.h where BasicStats is placed and there are no "median" or "se" methods.

Thank you.
Mike Buess Posted - 07/28/2004 : 12:08:23 PM
The example under Function:Data_Sum shows you how. Mean is bsStat.mean...

int iSize;
Dataset dsDataIn("Data1_B");
iSize=dsDataIn.GetSize();
Dataset dsSumOfDataIn("Data1_C");
dsSumOfDataIn.SetSize(iSize);
BasicStats bsStat;
Data_sum( &dsDataIn, &bsStat, &dsSumOfDataIn );
printf( "Min = %f\nMax = %f\nMean = %f\nSD = %f\nTotal = %f\nSSDM = %f\nN = %d\nMissing = %d\niMax = %d\niMin = %d",bsStat.min, bsStat.max, bsStat.mean, bsStat.sd, bsStat.total,bsStat.ssdm,bsStat.N, bsStat.Missing, bsStat.iMax, bsStat.iMin );


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/28/2004 12:17:05 PM

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