- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to extract repeated data in a multi-column matrix?
Thanks!
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to extract repeated data in a multi-column matrix?
The height and weight columns were also compared. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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