cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-423476%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%B1%87%E6%80%BB%E8%A1%A8%E5%9C%A8%E7%89%B9%E5%AE%9A%E6%9D%A1%E4%BB%B6%E4%B8%8B%E5%BF%BD%E7%95%A5%E6%9D%83%E9%87%8D%E5%88%97%EF%BC%88%E9%94%99%E8%AF%AF%EF%BC%9F%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-423476%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E5%8F%AA%E6%98%AF%E5%9C%A8%E7%8C%9C%E6%B5%8B%EF%BC%8C%E4%BD%86%E6%98%AF%E5%B0%86%E6%9D%83%E9%87%8D%E5%BA%94%E7%94%A8%E4%BA%8E%E5%88%86%E4%BD%8D%E6%95%B0%E6%88%96%E7%B4%AF%E7%A7%AF%E5%88%86%E5%B8%83%E5%87%BD%E6%95%B0%E6%98%AF%E5%90%A6%E6%9C%89%E6%84%8F%E4%B9%89%EF%BC%9F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%E8%BF%99%E5%AF%B9%E6%97%B6%E5%88%BB%E6%9C%89%E6%84%8F%E4%B9%89%EF%BC%8C%E4%BD%86%E5%8F%AF%E8%83%BD%E4%B8%8D%E9%80%82%E7%94%A8%E4%BA%8E%20CDF%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-423551%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E6%B1%87%E6%80%BB%E8%A1%A8%E5%9C%A8%E7%89%B9%E5%AE%9A%E6%9D%A1%E4%BB%B6%E4%B8%8B%E5%BF%BD%E7%95%A5%E6%9D%83%E9%87%8D%E5%88%97%EF%BC%88%E9%94%99%E8%AF%AF%EF%BC%9F%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-423551%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E6%88%91%E5%B7%B2%E7%BB%8F%E6%9B%B4%E6%96%B0%E4%BA%86%E6%8F%8F%E8%BF%B0%EF%BC%8C%E5%9B%A0%E4%B8%BA%E6%88%91%E5%8F%91%E7%8E%B0%E7%9A%84%E4%B8%BB%E8%A6%81%E9%97%AE%E9%A2%98%E6%98%AF%E5%AE%83%E5%BF%BD%E7%95%A5%E4%BA%86%E5%85%B6%E4%BB%96%E7%BB%9F%E8%AE%A1%E6%95%B0%E6%8D%AE%E7%9A%84%E6%9D%83%E9%87%8D%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E5%85%B3%E4%BA%8E%E4%BD%93%E9%87%8D%E4%B8%AD%E4%BD%8D%E6%95%B0%EF%BC%8C%E8%BF%99%E6%9C%AC%E8%BA%AB%E5%B0%B1%E6%98%AF%E4%B8%80%E4%B8%AA%E8%AF%9D%E9%A2%98%3A)%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWeighted_median%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWeighted_median%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-423170%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E6%91%98%E8%A6%81%E8%A1%A8%E5%BF%BD%E7%95%A5%E7%89%B9%E5%AE%9A%E6%9D%A1%E4%BB%B6%E4%B8%8B%E7%9A%84%E6%9D%83%E9%87%8D%E5%88%97%EF%BC%88%E9%94%99%E8%AF%AF%EF%BC%9F%EF%BC%89%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-423170%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E7%94%B1%E4%BA%8E%E6%9F%90%E7%A7%8D%E5%8E%9F%E5%9B%A0%EF%BC%8C%E5%9C%A8%E5%B0%86%E4%B8%AD%E4%BD%8D%E6%95%B0%EF%BC%88%EF%BC%89%E6%B7%BB%E5%8A%A0%E5%88%B0%E6%91%98%E8%A6%81%E6%97%B6%EF%BC%8C%E5%AE%83%E4%BC%9A%E5%BF%BD%E7%95%A5%E4%B8%BA%3CSTRONG%3E%E5%85%B6%E4%BB%96%E7%BB%9F%E8%AE%A1%E6%95%B0%E6%8D%AE%3C%2FSTRONG%3E%E6%8F%90%E4%BE%9B%E7%9A%84%E6%9D%83%E9%87%8D%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%E5%9C%A8%E8%BF%99%E9%87%8C%EF%BC%8C%E6%88%91%E5%88%9B%E5%BB%BA%E4%BA%86%E4%B8%80%E4%B8%AA%E7%AE%80%E5%8D%95%E7%9A%84%E8%BF%87%E6%BB%A4%E5%99%A8%EF%BC%8C%E5%85%B6%E4%B8%AD%E6%AF%8F%E4%B8%AA%E7%94%B7%E6%80%A7%E8%A1%8C%E9%83%BD%E6%9C%89%200%20%E4%BD%93%E9%87%8D%EF%BC%8C%E5%9B%A0%E6%AD%A4%E7%94%B7%E6%80%A7%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC%E5%92%8C%E6%9C%80%E5%B0%8F%E5%80%BC%E4%B8%8D%E5%BA%94%E8%AF%A5%E5%AD%98%E5%9C%A8%E3%80%82%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0A%0A%2F%2F%20New%20column%3A%20Filter%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%20%22Filter%22%2C%0A%09Numeric%2C%0A%09%22Continuous%22%2C%0A%09Format(%20%22Best%22%2C%2012%20)%2C%0A%09Formula(%20%3Asex%20!%3D%20%22M%22%20)%0A)%3B%0A%0Alist_columns_to_group%20%3D%20%7B%22height%22%2C%20%22weight%22%7D%3B%0A%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2F%20Ignores%20weights%20for%20max%2C%20min...%0Adt%20%26lt%3B%26lt%3B%20Summary(%20Group(%20%3ASex%20)%2C%0A%20Mean(list_columns_to_group)%2C%0A%20Max(%20list_columns_to_group%20)%2C%0A%20Min(list_columns_to_group%20)%2C%0A%20Median(list_columns_to_group)%2C%0A%20Weight(%3AFilter))%3B%0A%3CBR%20%2F%3E%3CBR%20%2F%3E%2F%2F%20Works%20as%20expected%0Adt%20%26lt%3B%26lt%3B%20Summary(%20Group(%20%3ASex%20)%2C%0A%20Mean(list_columns_to_group)%2C%0A%20Max(%20list_columns_to_group%20)%2C%0A%20Min(list_columns_to_group%20)%2C%0A%20%2F%2FMedian(list_columns_to_group)%2C%0A%20Weight(%3AFilter))%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22FN_0-1633414466115.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22FN_0-1633414466115.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F36299i7CEA75E1C9CC590C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22FN_0-1633414466115.png%22%20alt%3D%22FN_0-1633414466115.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-423170%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3E%E9%AB%98%E7%BA%A7%E7%BB%9F%E8%AE%A1%E5%BB%BA%E6%A8%A1%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E6%B6%88%E8%B4%B9%E8%80%85%E5%92%8C%E5%B8%82%E5%9C%BA%E7%A0%94%E7%A9%B6%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E5%86%85%E5%AE%B9%E7%BB%84%E7%BB%87%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E6%95%B0%E6%8D%AE%E6%8E%A2%E7%B4%A2%E4%B8%8E%E5%8F%AF%E8%A7%86%E5%8C%96%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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

Recommended Articles