For the latest version of JMP Help, visit JMP.com/help.


Scripting Guide > Scripting Platforms > Specify Which Columns to Analyze > Specify Multiple Column Names at Once
Publication date: 11/10/2021

Specify Multiple Column Names at Once

If you have a lot of column names, instead of listing each one individually, you can use lists as column arguments. The following example gets the Y column names from a list and creates a Oneway analysis on each column in the list.

dt = Open( "$SAMPLE_DATA/Cities.jmp" );
dt << Fit Group( Oneway( Y( {:SO2, :POP} ), X( :State ) ) );

If you do not know the column names when you are writing the script, use column indices, as done in the following example.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Distribution( Y( 1::N Col( dt ) ) );

You can also use indices when specifying effects as shown here:

dt << Fit Model( Y( :y ), Effects( 1 :: 4 ) );

Here’s another example of specifying multiple column names. 5::31 selects columns 5 through 31.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Baltic.jmp" );
dt << Partial Least Squares( Y( :ls, :ha, :dt ), X( 5 :: 31 ), Go );
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).