Scripting Guide > Scripting Platforms > Specify Which Columns to Analyze > Specify Multiple Column Names at Once
发布日期: 09/18/2023

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 );
需要更多信息?有问题?从 JMP 用户社区得到解答 (community.jmp.com).