Being really new to scripting in jmp. I have a question about this, here is a script that I wrote. What I intend to do is that I have two tables, Table one contains the limits of each test, for example, (keep in mind that the actual table has a few thousand tests, this is just an example)
Table 1
| Test | Lower Limit | Upper Limit |
|---|
| test 1 | 3 | 10 |
| test 2 | 3.4 | 12 |
| test 3 | 5 | 12 |
And the other table (Few thousand columns long) contains the test results
Table 2
| Test 1 | Test 2 | Test 3 |
|---|
| 5 | 6 | 8 |
| 5 | 6.1 | 8.11 |
| 5.2 | 6.23 | 8.12 |
And what I intend to do, is plot a variability chart for the second table for a few selected tests (4 or 5), and I would like the variability chart to autoplot reference lines based on limits from the first table - the upper and lower limit. Now I'm stuck in this situation where I dont know how to complete my script. Currently it looks like this, I can get the reference line to plot at a fixed point at, say "1". But what I want to be able to do is to extract whatever test that the user decides to plot, and extract the limits from the first data table, and plot the limits as a reference line.
Is there a way to extract the user selected parameters (X and Y) of the variability chart, and use that the search for its limits to plot the reference line? As of now, my code looks like this
dt_data1 = Data Table( 1 ); // the Limits table
dt_data2 = Data Table( 2 ); // the actual data table
//Start of GUI Window
//--------------------------------------------------------------------------------------------------
ColSel = Filter Col Selector( Data Table( dt_data1 ), 250, 10, ColumnToPlot = ColSel << Get Selected );
ColSel << Set Max Selected( 2 ); //Maximum allowed selected column is 1
win = New Window( "Test",
<<modal,
Text Box( "Columns to plot variability chart" ),
ColSel,
go = Button Box( "OK",
ColumnToPlot = ColSel << Get Selected
);
);
//-----------------------------------------------------------------------------------------------
//End of GUI Window
Wait( 1 );
Current Data Table(dt_data2);
Colnames = dt_data2 << Get Column Names(Numeric, string);
LowerLimit = colnames[2];
UpperLimit = colnames[3];
Current Data Table(dt_data1);
Variability Chart(
Max Iter( 100 ),
Conv Limit( 0.00000001 ),
Number Integration Abscissas( 128 ),
Number Function Evals( 65536 ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Points Jittered( 1 ),
Show Box Plots( 1 ),
Std Dev Chart( 0 ),
Show Range Bars( 1 ),
SendToReport(
Dispatch(
" ",
"2",
ScaleBox,
{Add Ref Line( 0, "Solid", "Black", "", 1 ),
Add Ref Line( 1, "Solid", "Blue", "", 2); } //Replace 1 by value imported
)
)
);