JSL messages to Fit GroupHow hard would it be to design JSL so that messages sent to Fit Group would be sent on to ALL of the Fit Model instances within the group?
For example, if I use Save Script to Data Table on a Fit Group, and then I want to add a single block of code to do the same analysis to all of the Fit Models in that Fit Group, can I do that? I know I can search and replace on the Fit Model calls and insert a copy of my code for each model.
Hopefully this makes sense.
Re: JSL messages to Fit GroupThis is great news. And JMP 15 is fine. JSL is flexible enough in this case that I can get the job done using the code I've already provided here. It just required me to invest some time to figure out how to get this to work. It will be nice to get a simpler approach in 15.
Re: JSL messages to Fit GroupThanks, Michael. That makes sense.
I've recorded the request and entered the Defect ID above.
I also spoke with @John_Sall who said he understood and thought he might be able to accomodate something like this in JMP 15.
Re: JSL messages to Fit GroupJeff,
Currently I'm taking a creative approach to this. In the following code, "script" and "multicomp" are expressions that I've defined earlier in the code. "script" is a Fit Group call. "multicomp" is an expression directing Multiple Comparisons(...).
newscript = Expr(Fit Group());
For(i=1,i<=N Arg(script),i++,
// look for Fit Model calls
If( Char( Head( Arg(script,i) ) ) == "Fit Model()",
workingarg = Expr(Fit Model());
// add multicomp request to Run argument, pass all other arguments through
For(k=1,k<=N Arg(Arg(script,i)),k++,
workingarglevel2 = Arg( Arg(script,i), k );
If( Char( Head( workingarglevel2 ) ) == "Run",
Insert Into(workingarglevel2, Name Expr(multicomp));
);
Insert Into(workingarg, Name Expr(workingarglevel2));
);
// make assignment function to store each fit model into list
assignment = Expr(Assign());
Insert Into(assignment, Substitute(Expr(fm[__i__]), Expr(__i__), i));
Insert Into(assignment, Name Expr(workingarg));
Insert Into(newscript, Name Expr(assignment));
,
// if not Fit Model, we just pass the argument through to Fit Group
Insert Into(newscript, Arg(script,i))
);
);It would be much easier if I could simply do script << Multiple Comparisons(...). This does still leave the puzzle of how I'm going to define my list "fm" which you also see referenced in the code, I need this to get at the reports for each fit in the Fit Group so I can extract the info from Multiple Comparisons(...) but that is perhaps a puzzle for a different day.
If I try to broadcast an argument to Fit Group that doesn't apply to all members of the group (for example, I know there's no Multiple Comparisons(...) in Gaussian Process), can JMP simply discard the request where it doesn't work? Something like how Try(...) works? It's almost like if I do Send(msg, fg) that all we need to do is iterate through each element of "fg" and do Try(Send(msg, elements[i]))?
Hopefully this clarification makes more sense.
Michael
Re: JSL messages to Fit GroupCan you provide an example of the "single block of code to do the same analysis"? Do you mean you want to fit the same model to each response?
One issue is that Fit Group() can have multiple fitting types, not just Fit Model. For example:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
obj = Fit Group(
Fit Model(
Y( :ABRASION ),
Effects(
:SILICA & RS,
:SILANE & RS,
:SULFUR & RS,
:SILICA * :SILICA,
:SILICA * :SILANE,
:SILANE * :SILANE,
:SILICA * :SULFUR,
:SILANE * :SULFUR,
:SULFUR * :SULFUR
),
Personality( Standard Least Squares ),
Emphasis( Minimal Report ),
Run()
),
Gaussian Process(
Y( :HARDNESS ),
X( :SILICA, :SILANE, :SULFUR ),
Set Correlation Function( "Cubic" )
)
);