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
 Calculate IQR of a column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Ecke

3 Posts

Posted - 09/25/2019 :  12:43:14 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 2018b, Windows 7

Hi, I would like to calculate the inter qaurtile range (IQR) of a column and write the value in a cell above the column.
I can do it for the median by entering the following command in a "parameter" cell above the column:
= median(col(J))

Is there a similar command for the IQR or just the first and third quartile?

I would be glad if someone could help.

best
Eckart

YimingChen

1691 Posts

Posted - 09/25/2019 :  2:07:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Eckart,

Please use this formula:
=percentile(This,{75})-percentile(This,{25})


James
Go to Top of Page

Ecke

3 Posts

Posted - 09/26/2019 :  12:21:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi James,
thank you for your answer. I tried entering the command and it did not fully work.
When I enter =percentile(This,{75}) it works but the subtraction of both terms "=percentile(This,{75})-percentile(This,{25})"doesn't give a result.

To give a bit more background. I want to plot a box plot and display the median and IQR for the different specimen series in the chart/legend below the box plot (see picture below). At the moment I calculate both values and write them in the cells above the data columns. If there was another way how to extract/display the data right out of the box plot, that would also be great.

Go to Top of Page

YimingChen

1691 Posts

Posted - 09/26/2019 :  2:23:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Echart,

You need to upgrade to 2019b to have full formula support in user defined parameter.

Or you can run Labtalk script to set longname as IQR:

for (int i = 1; i <= wks.nCols; i++)
{
	double dd = percentile(wcol(i),{75})-percentile(wcol(i),{25});
	wcol(i)[L]$ = $(dd);
}


James

Edited by - YimingChen on 09/26/2019 2:32:46 PM
Go to Top of Page

Ecke

3 Posts

Posted - 09/28/2019 :  06:44:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you James!
I will see if I can get Version 2019b.
If not I will use the labtalk script

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