Randomly select rows within a given column valueHello everyone,
First of all, I'm an occasional JMP user (v16.2) with little JSL experience and limited statistical knowledge. I couldn't directly find an answer on the community, I hope I'm not asking something which has already been answered. That being said, I've been trying to figure out how to do the question below 'manually' - using standard JMP functionalities. I couldn't find any simple way, so I hope somebody can give me a hint using JSL.
For a particular application request I would like to subset a large data table. More specifically, I would like to subset the table by randomly taking out a number of rows, for a specific column value. For example, I'd like to transfer the table attached to a new table, where I can obtain 3 (randomly chosen) values of column "Numerics" for each column value of column "condition".
Apart from the JSL solution, is there maybe a way to do this using any of the statistical platforms?
Thanks for the help!
Data Blending and CleanupQuality and Process EngineeringRe: Randomly select rows within a given column valueThanks! I completely missed the 'stratify' option, it was indeed very simple
.
Re: Randomly select rows within a given column valueHi @Nico_M,
Welcome in the Community !
If I understood correctly your need, you should be able to do this using the "Subset" platform in menu "Tables" :
- Click on menu "Tables", then "Subset" ; a new window opens,
- Specify "random - sample size" as 3 (or any number of rows you want per condition) and select stratify and choose the column "Condition" (as shown in the screenshot) :

- Click on "Ok" and you'll get a new subset table

Here is the JSL code on your example if you want to directly use it :
Data Table( "JMP replicates - community" ) << Subset(
Sample Size( 3 ),
Selected columns only( 0 ),
Stratify( :Condition )
)
I also send you back your datatable with the Subset table saved as a new script.
Hope this answer will help you,