For some reason, when adding to summary a Median(), it ignores the weights provided for other statistics.
Here, I am creating a simple filter where every male row has 0 weight, hence max and min for males should not exist.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// New column: Filter
dt << New Column( "Filter",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula( :sex != "M" )
);
list_columns_to_group = {"height", "weight"};
// Ignores weights for max, min...
dt << Summary( Group( :Sex ),
Mean(list_columns_to_group),
Max( list_columns_to_group ),
Min(list_columns_to_group ),
Median(list_columns_to_group),
Weight(:Filter));
// Works as expected
dt << Summary( Group( :Sex ),
Mean(list_columns_to_group),
Max( list_columns_to_group ),
Min(list_columns_to_group ),
//Median(list_columns_to_group),
Weight(:Filter));