turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Calculating Col Quantile by columns

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 20, 2015 4:06 PM
(2393 views)

Hi~

I'd like to calculate ** Col Quantile by Columns **

on the data table

by using JMP formula as below. (Note. Not from 'Tabulate' menu)

Do you have any idea with this?

Thanks in advance. : )

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Solution

Brady,

Thanks for catching my typo! I meant for the character-valued case to be this:

//When By variable is character-valued:

Quantile**(** **0.25**, **(**:height << **get values)[**loc**((**:sex << **get values)**,:sex**)]** **)**

Best,

Michael

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

4 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 21, 2015 9:54 AM
(1903 views)

Unfortunately, the Col Quantile function does not support a By variable. However, you can use the following formulas to get around this limitation:

//Examples using $SAMPLE_DATA/Big Class.jmp:

//When By variable is character-valued:

Quantile**(** **0.25**, **(**:height << **get values)[**loc**((**:sex << **get values)**,"M"**)]** **)**

//When By variable is numeric-valued:

Quantile**(** **0.25**, **(**:height << **get values)[**loc**((**:age << **get values)** == :age**)]** **)**

Hopefully, one of these two will work for your situation!

Michael

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 21, 2015 12:06 PM
(1903 views)

Using Michael's approach, you can also do the following for the character-valued scenario, to avoid having to list each group value explicitly:

Quantile**(**

**0.25**,

**(**:height << **get values****)[**Loc**(** :age << **get values**, :age**[**Row**()]** **)]**

**)**

If you need to use more than one grouping variable (say, 3 columns together, for instance) you would first concatenate the columns together to form a fourth, and use this new column as a (single) grouping column.

Cheers,

Brady

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Brady,

Thanks for catching my typo! I meant for the character-valued case to be this:

//When By variable is character-valued:

Quantile**(** **0.25**, **(**:height << **get values)[**loc**((**:sex << **get values)**,:sex**)]** **)**

Best,

Michael

Michael Crotty

Sr Statistical Writer

JMP Development

Sr Statistical Writer

JMP Development

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jan 21, 2015 4:58 PM
(1903 views)

WOW!!!!

It's marvelous solution!

and I learned 'get values' and 'location' formula from you.

Thank you so much Michael and Brady!