BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted

Fit Model DisplayBox Value Extraction

Hi, here is my daily inquiry about some basic process in JMP script:

I'm trying to capture the p values produced by the Fit Model > Effect Test into a new table.

Here is what I have so far:

Names Default to Here(1);

dt = Current Data Table();

m = {};

m1 = [];

m2 = [];

j = 9;

For(i=175, i<= N Col (dt),i++,

fm = Fit Model(

Y( Column ( i ) ),

Effects( :TRT01P, Column (j) ),

Personality( Standard Least Squares ),

Emphasis( Effect Leverage ),

invisible,

Run(

Column ( i ) << {Lack of Fit( 0 ),

Plot Actual by Predicted( 1 ), Plot Residual by Predicted( 1 ),

Plot Effect Leverage( 1 )}

)

);

fmr = fm << report;

insert into (m, Column Name (i));

m1 = m1 || fmr[OutlineBox (8)][Number Col Box (21)] ; // Error message " Cannot subscript DisplayBox"

m2 = m2 || fmr[OutlineBox (8)][Number Col Box (21)] ;

j=j+2;

);

New Table ("ANCOVA",

New column ("Header", character, set values (m)),

New column ("Treatment", numeric, set values (m1)),

New column ("Linear Covariate", numeric, set values (m2))

);

Re: Fit Model DisplayBox Value Extraction

This reference is a bit tricky.  When you look at the probability in the Tree Structure, you can see that is is actually in a subsub structure of the Table Box. Therefore, you need to reference the complete path, and then you need to use a "<< get" message to retrieve the list, and finally, to select off the first element of the list.  Here is the reference that retrieves the p value

m1 = m1 || (fmr[Outline Box( 8 )]<<get);

The easiest way to get to the second value you are looking for, is to go directly to the unique name of the outline box, "Effect Tests", and then just drill down from there

(fmr["Effect Tests"]<<get)

Jim