scripting a model dialogis it possible manipulate a model dialog within a script?
In particular in generalized regression the message 'Relaunch with Active Effects' opens a model dialog, but I can't work out how to run the dialog. The cluster variables platform has a similar problem. You can send the message << Launch Fit Model which opens a model dialog but I don't know how to work with the dialog in my script.
example script from help system
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
fm = Fit Model(
Y( :Y ),
Effects(
:Age,
:Gender,
:BMI,
:BP,
:Total Cholesterol,
:LDL,
:HDL,
:TCH,
:LTG,
:Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Validation( :Validation ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( Validation Column )
)
)
);
fm << (fit[1] << Relaunch with Active Effects);
Re: scripting a model dialogI believe that the "Relaunch with Active Effects is intended to be an interactive tool, and that if you want to imitate the interactive actions, you should pull the information from the report, and reissue the Fit Model code with JSL. See below for an example
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
fm = Fit Model(
Y( :Y ),
Effects(
:Age,
:Gender,
:BMI,
:BP,
:Total Cholesterol,
:LDL,
:HDL,
:TCH,
:LTG,
:Glucose
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Validation( :Validation ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( Validation Column )
)
)
);
// Parse out the Effect Tests table to get the remaing effects
RemainingEffects = report(fm)["Effect Tests"][StringColBox(1)]<<GET>=1,i--,
if(Notes[i]=="Removed",
RemainingEffects = remove(RemainingEffects,i,1);
)
);
// Run the new model
fm2 = Fit Model(
Y( :Y ),
Effects(
eval(RemainingEffects)
),
Personality( "Generalized Regression" ),
Generalized Distribution( "Normal" ),
Validation( :Validation ),
Run(
Fit(
Estimation Method( Lasso( Adaptive ) ),
Validation Method( Validation Column )
)
)
);</GET>
Re: scripting a model dialogNever mind I just figured out one option - just send the click message to the run button, as in
window("Report: Fit Model")[buttonbox(9)] << click;maybe there is a more elegant way to do this?
thanks
Gunter