Calculate Standard Deviation

Hi everybody, I’ve been trying to solve this problem, but I was unable to do it.
I have a datatype called SET with a numeric field called Score and a text field called Class.
I need to calculate the standard deviation of Score, grouping by Class (same values). The output should be a list of standard deviations (one per each Class) so I can use it in a bar chart.
I could do it easily using the GroupBy feature, but it does not calculate standard deviation.
I tried with different approachs, but nothing worked. Most of plugins I tried do not throw a list of numbers, only a single value.

Anyone who had this problem and could solve it?
Thanks a lot!

Hi @quinteros.leonardo ,

With parenthesis you should be able to assemble the equation you want. Albeit it might be pretty complicated since I just looked up standard deviation and my brain did this :exploding_head:

A trick is to use Search for SETs:format as text, do some math on the individual data point by referencing This SET's Score, use something as a delimiter, then do :split by [delimiter] :each item converted to number to get the list of numbers again

May still need to group them by Class first, then do math only searching for data points relevant to that Class. I would imagine you’ll have some nested :format as texts and searches.

Another option is maybe a server side action via Javascript, let me know maybe it’s an easy one to put a plugin together. Or plugin element on page.

Hi @tylerboodman , thank you very much for your answer.
I’ll try the approach you said, the only problem is the complexity of calculating standard deviation :sweat_smile:
I’ll give it a try and let you know.

1 Like