Pages: [1]
  Print  
Author Topic: [SOLVED] Average/deviation by group  (Read 474 times)
andreister
Newbie
*
Posts: 2


« on: September 29, 2013, 11:50:06 PM »

I have a data set  where one of the columns is category. And I want to calculate the mean and standard deviation of some other column, but separately for each category.

Ie., for input like

GroupName...Value
A.......................1
A.......................3
B......................1
B.......................5

I want the output like

GroupName...Value...Mean...StdDev
A.......................1...........2...........1.44          
A.......................3...........2...........1.44
B.......................1...........3...........2.8
B.......................5...........3...........2.8


I know how to get the group means and standard deviations via Aggregate operator, but I dont know how to add the new columns to the original dataset. What am I missing?

Thanks!
« Last Edit: September 30, 2013, 01:56:46 PM by andreister » Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #1 on: September 30, 2013, 09:15:03 AM »

Add an ID attribute before the Aggregate operator, then join the results of Aggregate to the original data using the Join operator and the id attribute.

Best regards,
Marius
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
andreister
Newbie
*
Posts: 2


« Reply #2 on: September 30, 2013, 01:23:08 PM »

Ok  great - Join operator was the missing part.

I put "inner" join and selected my grouping attribute for both left and right subsets, works like a charm.
« Last Edit: September 30, 2013, 01:56:27 PM by andreister » Logged
Marius
Administrator
Hero Member
*****
Posts: 1794



WWW
« Reply #3 on: September 30, 2013, 01:24:10 PM »

Hi, uncheck the parameter and join by the group attributes instead.
Logged

Please add [SOLVED] to the topic title when your problem has been solved! (do so by editing the first post in the thread and modifying the title)
Please click here before posting.
Pages: [1]
  Print  
 
Jump to: