cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
lala
Level VIII

How to extract repeated data in a multi-column matrix?

2022-07-29_18-43-04.pngThanks!

 

 

2 REPLIES 2
lala
Level VIII

Re: How to extract repeated data in a multi-column matrix?

The height and weight columns were also compared. Thanks!
txnelson
Super User

Re: How to extract repeated data in a multi-column matrix?

Here is one way of retrieving the frequency counts from a matrix

Names Default To Here( 1 );
dt = // Open Data Table: big class.jmp
// → Data Table( "big class" )
Open( "$SAMPLE_DATA/big class.jmp" );;
ar = dt << getasmatrix( {4, 5} );


dt_freq = New Table( "dt_freq", private, New Column( "groups" ) );
dt_freq:groups << set values( ar[0, 2] );
Summarize( dt_freq, Bygroup = by( :groups ), ngroups = Count( :groups ) );
Close( dt_freq, nosave );
For Each( {value, index}, Bygroup, Bygroup[index] = Num( Bygroup[index] ) );
bygroup = Matrix( bygroup );
theReturned = bygroup || ngroups;
Jim