Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
vishwasanj
Level V

Table Box (Data table col box)

Hi All,

 

I have been working on this idea for the past week or so and @gzmorgan0 helped me with this post 

https://community.jmp.com/t5/Discussions/creating-an-index-for-columns-to-point-to-the-graph/m-p/715...

say for example, I loop through 5 continuous columns and 2 nominal columns, I plot one way analysis of 10 columns(say nw2). I get the p-value and other parameters in a table. I want the table sorted in an ascending order of p-value. Can I have my table in a new window(nw1) and each of the row(as the row has both the appropriate X and Y axis relating to the graph) in the table should reference to the appropriate graph in the nw2? Is Table Box (Data table col box) the right strategy or there is some other function I should be looking into?

 

I appreciate any input/comments/suggestions.

  

Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
 
ynames = {"weight", "height"};
xnames = {"sex", "age"};
pnames = {};
nw2 = New Window( "Custom Display", vl = V List Box() );
nw2 << Size Window( 724, 395 );
For( i = 1, i <= N Items( ynames ), i++,
	For( j = 1, j <= N Items( xnames ), j++,
		Insert Into( pnames, ynames[i] || " by " || xnames[j] );
		vl << Append(
			Oneway(
				Y( Column( dt, ynames[i] ) ),
				X( Column( dt, xnames[j] ) ),
				Box Plots( 1 ),
				Comparison Circles( 0 ),
				X Axis Proportional( 0 ),
				Means Diamonds( 1 ),
				Points Jittered( 1 ),
				SendToReport(
					Dispatch(
						{},
						"Oneway",
						OutlineBox,
						{Set Title( Eval Insert( "^ynames[i]^ ^xnames[j]^ Comparison Report" ) )}
					)
				)
			)
		);
	);  //end for j	
);  //end for i  

plb = List Box( pnames, width( 100 ), maxSelected( 1 ) );

  
nw1 = New Window( "Filter", plb );

_xx = (nw2 << Child) << xpath( "//OutlineBox[@helpKey='Oneway Report']" );


plb << Set Function(
	Function( {this},
		k = (this << get Selected Indices)[1];
		nw2 << Scroll Window( _xx[k] );
	)
);

nw1 << Bring Window to Front;
nw2 << Bring Window to Front;
nw1 << Move Window( 10, 10 );
nw2 << move Window( 180, 10 );

//Add a try in case the window is already closed
nw2 << On close( Try( nw1 << Close Window() ) );
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
gzmorgan0
Super User

Re: Table Box (Data table col box)

  • Run the Oneway analysis within a VListbox(); A report will remain interactive (live). For each analysis stor the p-value in a list.
  • Investigate the matrix function rank(). Use it on the pvalue list, it returns the indices of the p-values and hence the oneways from low to high. r = rank(plist).
  • Set pnames = pnames[r].  This will order the names of the analyses from low to high.
  • Then from i=1 to number of analyses append to the window vlist box  << append(VL[ r[i] ] ) 

 

View solution in original post

5 REPLIES 5
Highlighted
msharp
Super User

Re: Table Box (Data table col box)

I'm not really understanding your question, your code appears to do what you are asking.  However, I wouldn't ever have one window affect the results of a second window.  I would suggest you put both your filter and oneway plots in the same window, and you can split them with a scroll box.

Highlighted
gzmorgan0
Super User

Re: Table Box (Data table col box)

  • Run the Oneway analysis within a VListbox(); A report will remain interactive (live). For each analysis stor the p-value in a list.
  • Investigate the matrix function rank(). Use it on the pvalue list, it returns the indices of the p-values and hence the oneways from low to high. r = rank(plist).
  • Set pnames = pnames[r].  This will order the names of the analyses from low to high.
  • Then from i=1 to number of analyses append to the window vlist box  << append(VL[ r[i] ] ) 

 

View solution in original post

Highlighted
gzmorgan0
Super User

Re: Table Box (Data table col box)

This took a little more than what I documented.  A sample script is attached.

Highlighted
msharp
Super User

Re: Table Box (Data table col box)

gzmorgan appears to have answered your question, but you private messaged me, so I thought to elaborate on the scroll box.  Attached is an editing of gzmorgan's implementation to use one window versus two.

 

The downside of the scroll box is that it doesn't support the << Scroll Window() command for whatever reason.

Highlighted
gzmorgan0
Super User

Re: Table Box (Data table col box)

Yes, I thought a single window viewer would be best and had the same problem that scroll window would not work for a nested scroll box. I reported it to JMP so the developers are aware of the issue.  JMP Support provided the attached script that demonstrates using << Get Offset to find the position more reliably. 

Article Labels

    There are no labels assigned to this post.