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

- 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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jul 16, 2015 5:14 AM
(7234 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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

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

7 REPLIES 7

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

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

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

Re: Formula for grouped statistics

Thanks!

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

Re: Formula for grouped statistics

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

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

Re: Formula for grouped statistics

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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Formula for grouped statistics

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
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Formula for grouped statistics

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

Highlighted
##

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

Re: Formula for grouped statistics

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.