Subscribe Bookmark RSS Feed

Simple JSL automation script

Hi,
I have found the learning curve to getting started with JSL to be pretty steep, so I'm hoping someone here can shed some light on what I'm hoping is a very simple script.

I want to do a Test Mean on my data. Something like this:



But I would like to do it separately for each possible category in my column called GROUP. My actual data has 100+ possible groups, and I don't want to hardcode these in.

Ideally, I would like to make this script as generic as possible, so if I load another data table, and VOLDIFF is called PRCTDIFF for example it would still work by passing the name of the column as a parameter or something. Is this possible?

thanks


Message was edited by: mishkind

Message was edited by: mishkind
4 REPLIES
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Hello there,

What you're doing is what JMP does with a By column.

To see this open the Big Class table from the Sample Data (Help->Sample Data; then look under Examples for Teaching).

Then choose Analyze->Distribution and put "height" in the "Y, columns" role and "sex" in the "By" role. You'll get one distribution for each gender.

To see the equivalent script, use the red triangle at the top of either of the distributions and choose "Script All By-groups -> Save Script to Script Window". You'll get the following script:

Distribution( Continuous Distribution( Column( :height ) ), By( :sex ) );

As for parameterizing your script it can look something like this:



y Column = Column( "height" );
by Column = Column( "sex" );

Eval(
Substitute( Expr( Distribution( y( yc ), By( bc ) ) ),
Expr( yc ), y Column,
Expr( bc ), by Column
)
);


Jeff
-Jeff
Hi Jeff,
Thanks for the response. That is exactly what I was looking for.
The problem is with my version of JMP I think, because I followed your example exactly, but when I click the red triangle at the top of either of the distributions I don't have the option "Script All By-groups", only Script->Save Script for All Objects, which produces this output:



I'm using JMP 7.0.2 on linux. I take it you are using JMP 8?
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Yes, I'm using JMP 8.

The By Group scripting options were an improvement added in JMP 8.

Jeff
-Jeff
For the first part I believe you can do the following: