cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
RA899
Level III

Finding the mean, sigma, or median for a column certain conditions

Hi all, 

I'm trying to find the mean, median and sigma for a column with certain conditions. For example, I need to get the mean for a test at certain frequency and a certain bandwidth.  Something like this: Col Mean where ( :column1 < Limit & :BW == Y & :Freq == XXX ); 

 

your help is appreciated

5 REPLIES 5
jthi
Super User

Re: Finding the mean, sigma, or median for a column certain conditions

Where do you need to add these values? You can create a subset with those specific conditions and perform calculations there, you can perform the calculation using scripting or you can create formula column to calculate those values.

-Jarmo
RA899
Level III

Re: Finding the mean, sigma, or median for a column certain conditions

I'm using jsl code to run multiple tests and plot them using graph builder. I need to get the sigma, mean, and median values before plotting the results. I think creating a subset would make it harder to plot since I have tens of tests to plot. Is there are a different method to get those values without creating a subset ? If not, please help with reference to the syntax needed for this. Thanks! 

RA899
Level III

Re: Finding the mean, sigma, or median for a column certain conditions

So one thought I had is to use something like row exclusion functions when finding the mean as an example. 

jthi
Super User

Re: Finding the mean, sigma, or median for a column certain conditions

Using formula like Jim suggested is most likely the easiest option. Depending on your data, you might also consider first stacking the data and then adding the test as grouping variable.

-Jarmo
txnelson
Super User

Re: Finding the mean, sigma, or median for a column certain conditions

Here is a formula that will do what you want

Col Mean( if(:column1 < :Limit & :BW == "Y" & :Freq == 42, :column1, . ) );
Jim