Subscribe Bookmark RSS Feed

Fit Model DisplayBox Value Extraction

sornasst

Community Trekker

Joined:

Feb 2, 2016

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)] [1]; // Error message " Cannot subscript DisplayBox"

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

  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))

);

1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

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.

10933_pastedImage_2.png

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 )][1][5][2]<<get)[1];

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"][1][6]<<get)[1]

Jim