–
|
Include the Run Model message in your script.
|
–
|
•
|
To run the model without showing the launch window, include the Run message in your script.
|
When a data table contains a Model script and you launch Fit Model interactively, the Fit Model launch window is pre-populated according to the roles assigned by the table script.
If you want to fit different models and see a shared Profiler so that you can compare the models, use the Fit Group function. You can fit models such as least squares, nonlinear, neural, Gaussian processing, and mixed, in the same window with a shared Profiler. The following example creates both a Standard Least Squares model and a Gaussian Process model.
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
obj = dt << 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" )
)
);
In the report, click the Fit Group red triangle and select Profiler. Scroll down to the Prediction Profiler. You can see the ABRASION row for the SLS model, and the HARDNESS row for the Gaussian Process model appearing in the same profiler.
Effects( list of effects, list of effect macros, or both lists );
An effect can be a column name, a crossing of several column names with asterisk (*) notation, or nested columns specified with subscript bracket ([ ]) notation. Additional effect options can appear after an ampersand (&) character. Here are some examples:
A, // a column name alone is a main effect
A*B, // a crossed effect, interaction, or polynomial
A[B], // nested
A*B[C D], // crossed and nested
effect&Random, // a random effect
effect&LogVariance, // a variance model term
effect&RS, // a response surface term
effect&Mixture, // for an effect participating in a mixture
effect&Excluded, // for an effect that with no model arguments
effect&Knotted, // for a knotted spline effect
Factorial( columns ), // for a full factorial design
Factorial2( columns ), // for up to 2nd-degree interactions only
Polynomial( columns ), // for a 2nd-degree polynomial only
manovaObj << ( Response[ 1 ] << {response options} );
manovaObj << ( Response[ "Contrast" ] << {response options} );
Each response function supports the Custom Test message:
Custom Test( matrix, <Power Analysis( ... )>, <Label( "..." )> )
where each row of the matrix specifies coefficients for all the arguments in the model.
To address an individual Effect test, use subscripted Effect with a name or number:
manovaObj << ( Response[1] << ( Effect["Whole Model"] << {effect options} ) );
manovaObj << ( Response[1] << ( Effect[i] << {effect options} ) );
•
|
Each effect in each response function supports the following messages, where each row of the matrix has coefficients for all the levels in the effect:
Test Details( 1 ),
Centroid Plot( 1 ),
Save Canonical Scores,
Contrast( matrix, <Power Analysis(...)> );
dt = Open( "$SAMPLE_DATA/Dogs.jmp" );
manObj = dt << Fit Model(
Y( logHist0, logHist1, logHist3, logHist5 ),
Effects( dep1, drug, drug * dep1 ),
Personality( "MANOVA" ),
Run Model
);
manObj << Response Function( "Contrast" );
manObj << (Response["Contrast"] << (Effect["Whole Model"] <<
Test Details( 1 )));
// send the Test Details message to the Whole Model outline under Contrast in the report window
manObj << (Response[1] << (Effect[3] << Test Details( 1 )));
// send the Test Details message to response 1 (Contrast) and effect 3 (drug*dep1)
When you have multiple responses, you can send messages to a specific response column’s fit. Use the following JSL (where responseName is the specific response):
fitObj << ( responseName << {options, ...});
The second Send() function finds the named response and sends the list of messages to it.
Note: If you send the messages directly to the fitObj with a single Send() function, the messages are sent to all responses.
In the following script, the last line sends a message to the AICc report for the ABRASION response:
dt = Open( "$SAMPLE_DATA/Tiretread.jmp" );
fitObj = dt << Fit Model(
Y( :ABRASION, :MODULUS, :ELONG, :HARDNESS ),
Effects(
:SILICA & RS,
:SILANE & RS,
:SULFUR & RS,
:SILICA * :SILICA,
:SILANE * :SILICA,
:SILANE * :SILANE,
:SULFUR * :SILICA,
:SULFUR * :SILANE,
:SULFUR * :SULFUR
),
Personality( "Standard Least Squares" ),
Run
);
fitObj << (:ABRASION << {AICc( 1 )}); // shows up under the Box-Cox Transformations plot
fitObj << ( responseName << ((effectName) << effectOption ));
•
|
In a script, the Y responses are fit together by default. The model fits each Y using only those rows that are nonmissing for all of the Y variables. For example, a row that includes one or more missing Y values is excluded from the model. You can explicitly include Run( "Fit Together" ) in a script to get the same result.
|
•
|
If you include the Run( "Fit Separately" ) option, the model fits each Y using all rows that are nonmissing for that particular Y. For example, a row that includes one or more missing Y values is included in the model.
|
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Fit Model(
Y( :height, :weight ),
Effects( :sex ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run // or Run( "Fit Together" )
);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Fit Model(
Y( :height, :weight ),
Effects( :sex ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run( "Fit Separately" )
);