Hi,
I am trying to calculate the mean and median of the standard deviation by group for multiple columns in JSL. The data table I'm using is shown below and attached. I have verified the correct calculations in the columns to the right of the values but the JSL output does not match exactly. The code below correctly calculates the mean of the standard deviation by group for both values, but the median only calculates correctly for the first value; the result for the median of the second value is exactly the same as what was calculated for the first value. I cannot figure out why the mean values update correctly in the loop but not the median values. Any help on this is appreciated and please let me know what the best method in JSL is to do this.

JSL:
For( i = 2, i < 4, i++,
N = Column Name( i );
Print( "i = " || Char( i ) );
Print( "Column Name = " || Char( Column Name( i ) ) );
Print( "Column Mean Std Dev by Group = " || Char( Col Mean( Col Std Dev( N, :Group ) ) ) );
Print( "Column Median Std Dev by Group = " || Char( Col Median( Col Std Dev( N, :Group ) ) ) );
);
JSL Output:
"i = 2"
"Column Name = Value 1"
"Column Mean Std Dev by Group = 3.9849040980727"
"Column Median Std Dev by Group = 3.60555127546399"
"i = 3"
"Column Name = Value 2"
"Column Mean Std Dev by Group = 5.14008843607314"
"Column Median Std Dev by Group = 3.60555127546399"
JMP Pro v16
Thanks