The title is a bit hard to understand.
Take this big class as an example:
1. First, summarize the average values of "height" and "weight" by age.
2. Then summarize the median of "height" and "weight" by age.
3. Then compare the mean and median of "height" and take their minimum.
Finally, compare the mean and median of "body weight" and take their minimum.
I'll use the following code and finally loop through to get the minimum.
Is there any good code that minimizes this comparison?
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d1 = dt << Summary(
Group( :age ),
Mean( :height ),
Mean( :weight ),
Median( :height ),
Median( :weight ),
Freq( "None" ),
Weight( "None" ),
Link to original data table( 0 ),
statistics column name format( "column" )
);
c = N Col( d1 ) / 2 - 1;
For( i = 1, i <= c, i++,
ca = Column( i + 2 ) << Get Name || "0";
d1 << New Column( ca, formula( Min( As Column( 2 + i ), As Column( 2 + c + i ) ) ) );
d1 << run formulas;
Column( ca ) << deleteFormula;
);
Thanks!