Formula for grouped statistics<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />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
Re: Formula for grouped statisticsThe "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.
Re: Formula for grouped statisticsif you give an example perhaps i can understand better what you are looking for.
Re: Formula for grouped statisticsHi 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
Re: Formula for grouped statisticshi ram.asra@gmail.com,
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
Re: Formula for grouped statisticsCan it give only one unique value, instead of repeated data points?
Re: Formula for grouped statisticsThanks!
Re: Formula for grouped statisticsUse the following formula: Col Mean(:myValues, :myGroups)