- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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));
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
In statistics, a weighted median of a sample is the 50% weighted percentile. It was first proposed by F. Y. Edgeworth in 1888. Like the median, it is useful as an estimator of central tendency, robust against outliers. It allows for non-uniform statistical weights related to, e.g., varying ...