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
- :
- Formula for grouped statistics

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

Jul 16, 2015 5:14 AM
(1123 views)

Hi

I think it's trivial but I've only started to learn JSL syntax and I'm struggling with this one.

Saying I have a column "myValues" that contains my numeric values and a column "myGroups" that is a categorical variable to group my values together. What formula can I use in a third column to get the mean of "myValues" group by group.

E.g.

myValues | myGroups | myMeans |
---|---|---|

1 | A | 2 |

2 | A | 2 |

3 | A | 2 |

4 | B | 5 |

5 | B | 5 |

6 | B | 5 |

7 | C | 7.5 |

8 | C | 7.5 |

9 | D | 9 |

Thank you

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

Use the following formula: Col Mean(:myValues, :myGroups)

7 REPLIES

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

Solution

Use the following formula: Col Mean(:myValues, :myGroups)

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

Jul 16, 2015 7:45 AM
(929 views)

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

Oct 17, 2015 10:26 PM
(929 views)

Can it give only one unique value, instead of repeated data points?

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

Oct 19, 2015 4:38 AM
(929 views)

for unique values try using Table Summary.

by the way, summarizing the table and then updating the original table can produce the same result as guilhem was asking for just without the formula.

ron

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

Oct 19, 2015 7:31 AM
(929 views)

Hi Ron,

yes, that would produce the same result. so i was asking if JMP can have non repeated data functionality in col mean( my values, mygrps).

Thanks

ram

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

Oct 19, 2015 10:07 AM
(929 views)

if you give an example perhaps i can understand better what you are looking for.

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

Oct 20, 2015 2:44 AM
(929 views)

The "ColStat" fumctions is mainly useful in column formulas and cannot return non-repeated values as far as I know.

But Summarize() can. Example:

Summatize**(**g = group**(**:mygrps**)**, m = Mean**(**my values**))**

Where **m** is matrix of the mean at each level of **g**, a list of group names (as strings). Excluded rows are not included.