cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Instantly extract effect sizes, F-ratios, and FDR-adjusted p-values from your models with the Calculate Effects Sizes extension, available now in the JMP Marketplace!
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • See how to use the JMP Marketplace – Free tools to expand JMP capabilities. Register. July 10, 2 pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
lwx228
Level VIII

How can this "weight" classification be made faster?

The segmentation points of each body weight were calculated by combining and classifying the "Big Class.jmp", age and sex.
Each weight in each segment was then compared to these segment points to calculate the weight classification.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Column( "TYP" );
Column( "TYP" ) << Formula( Char( age ) || sex );
dt << run formulas;
Column( "TYP" ) << deleteFormula;

d2 = dt << Summary(
	Group( :TYP ),
	Quantiles( 25, :weight ),
	Median( :weight ),
	Quantiles( 75, :weight ),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table( 0 )
);
Column( d2, 3 ) << set name( "A" );
Column( d2, 4 ) << set name( "B" );
Column( d2, 5 ) << set name( "C" );
Current Data Table( dt );
dt << Update( With( d2 ), Match Columns( TYP = TYP ) );
Column( "N Rows" ) << Formula( If( weight > C, 4, If( weight > B, 3, If( weight > A, 2, 1 ) ) ) );
dt << run formulas;
Column( "N Rows" ) << deleteFormula;

2021-08-23_213559.png

 

If the data is large, and the classification, and segmentation points are large.
How can this "weight" classification be made faster?

Thanks Experts!

1 REPLY 1
lwx228
Level VIII

Re: How can this "weight" classification be made faster?

This step can be omitted

Column( "TYP" ) << Formula( Char( age ) || sex );

Recommended Articles