cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Register for our Discovery Summit 2024 conference, Oct. 21-24, where you’ll learn, connect, and be inspired.
Choose Language Hide Translation Bar
FN
FN
Level VI

Summary table ignoring weight column in specific conditions (bug?)

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));

FN_0-1633414466115.png

 

2 REPLIES 2

Re: Summary table ignoring weight column in specific conditions (bug?)

I'm just guessing, but does it make sense to apply a weight to a quantile or the cumulative distribution function?

 

It makes sense with moments, but maybe not with the CDF.

FN
FN
Level VI

Re: Summary table ignoring weight column in specific conditions (bug?)

I have updated the description as the main issue I found is that it ignores the weights for other statistics.

 

About weight median, this is a topic by itself

https://en.wikipedia.org/wiki/Weighted_median