cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

Randomize rows from a datatable

What inspired this wish list request? This wish list is directly inspired by the post Randomize rows from a datatable, where I was searching for a way to simply randomize rows from a design created in two steps (Custom design followed by Space-Filling augmentation).

 

What is the improvement you would like to see? Currently, the workaround found by @jthi is to use the "Subset" feature from Table menu, and use the setting "Random" with a sample size of 1. It works, but this is only a workaround, and a more intuitive feature could be added in this "Table" menu (or "Rows"), with perhaps different ways to organize/randomize rows. 

 

Why is this idea important? There might be multiple use cases when randomization is necessary, and since the technical feasibility is not high, this could be an important feature to add. Being able to select rows and randomize only the selected subset could be great when dealing with replicated designs Replicates in a RSM design table.

As JMP is enforcing good and safe practices for statistical analysis, a "Randomize" feature would be welcome !

 

 

3 Comments
hogi
Level XII

you could use @jthi approach and create a jsl file which executes the step.
Such Scripts can be added to the main menu, either via

hogi_0-1742574474933.png

or via an AddIn.

MathStatChem
Level VII

Another relatively simple way to do this is to:

  • Create a new column in the data, and Initiate the values with random uniform number.
  • sort the table by that column.

The resulting table will be in a randomized order.  

 

Simple script to do this:

 

Names Default To Here( 1 );

dt = Current Data Table();

dt << New Column("Random Ordering Value");
For Each Row( dt, :Random Ordering Value = Random Uniform( 0, 1 ) );

dt << Sort(
	By( :Random Ordering Value ),
	Replace Table,
	Order( Ascending )
);

dt << Delete columns(:Random Ordering Value);

 

 

Status changed to: Acknowledged

Thank you for submitting this request! We appreciate your feedback and the workarounds shared by other users in the comments.