Dear All,
I am writing a script that will be deployed to users in my organization to perform some simple quick statistics for the user without having to invoke the Distribution platform. The script is below with a screenshot of what I currently have, then a list of the things I'm having trouble with. The users will be running JMP 16.1, I am running JMP Pro 16.0. All machines are windows 10, 64-bit machines.
The intended purpose of the script is to show the numerical columns (maybe later I will deal with categorical columns) and depending on which radio button is selected, it will perform some simple statistics and display the results in the same window with a column labeled Stats for the type of statistic calculated and Values for the results of said calculations. The Results panel box should update upon the selection of the radio button after they have selected the appropriate column in the Select Column panel box.
Current JMP script (FYI, I'm testing it out on the familiar Big Class.jmp file):
Names Default To Here( 1 );
//Clear Symbols();
//the width of the column list box in pixels
lbWidth = 100;
dt = Current Data Table();
//List of statistics to calculate
StatsListA = {"Mean", "Std Dev", "Max", "Min", "Range", "N"};
StatsListB = {"95% quantile", "50% quantile", "5% quantile"};
StatsListC = {};
//Expression to do math
MathA = Expr(
response_col = Column( dt, Eval( Eval Expr( Expr( ycols ) ) ) );
ymean = Col Mean( response_col );
ystdev = Col Std Dev( response_col );
ymin = Col Min( response_col );
ymax = Col Max( response_col );
yrange = ymax - ymin;
yN = Col Number( response_col );
NumResultsA = {ymean, ystdev, ymin, ymax, yrange, yN};
);
//Expresseion for other math
MathB = Expr(
);
ValueDlg = Expr(
nwin = New Window( "GUI for quick stats",
<<Return Result,
<<On Validate,
Border Box( Left( 3 ), Top( 2 ),
V List Box(
Text Box( "Quick Stats Window", <<Set Font Size( 12 ) ),
H List Box(
V List Box(
Panel Box( "Select Columns", ColListData = Col List Box( dt, All, Grouped, width( lbWidth ), nLines( 10 ) ) ),
Panel Box( "Choose quick stats",
V List Box(
qstats = Radio Box(
{StatsListA, StatsListB, StatsListC},
<<Set Function(
Function( {this, index},
{lb},
lb = this << sib;
((lb << child) << sib) << Set Text( Char( index ) );
((((lb << child) << sib) << sib) << sib) << Set Text( Char( this << get selected ) );
)
)
)
)
),
),
Panel Box( "Results", Lineup Box( N Col( 1 ), H List Box( String Col Box( "Stats", {} ), Number Col Box( "Values", {} ) ) ) ),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "Cancel/End", nwin << Close Window ),
Text Box( " " ),
Button Box( "Help", Web( "https://www.jmp.com/en_ch/support/online-help-search.html?q=*%3A*" ) )
)
),
),
),
),
);
);
ValueDlg;
This is what I have so far:

Here is the list of things I'm having trouble with:
- The call for the Radio Box() lists the local variable name "StatsListA", etc. instead of actually listing out the stats that will be calculated. For example, the first radio button should have the following list behind it: Mean, Std Dev, Max, Min, Range, N. This should also be for the StatsListB and StatsListC (I haven't defined the C list yet). I'm not sure how to get it to evaluate the pre-defined list I make at the top of the JSL code. I'd prefer not to have to write out each and every item as I might want to change the items in the list and it's easier to change the local variable StatsListX instead of editing the Radio Box() call each time.
- Right now, I'd prefer to not list ALL columns, but just numeric. When I change the option in Col List Box() from All to Numeric (with or without ""), I get an empty list of columns. Can't figure out why this is happening, when it should list only the Numeric columns when I have that option defined.
- This is the hardest one I think: As mentioned before, I'd like the results in the Panel box "Results" to be updated with a column on the left "Stats" (which lists the statistics from StatsListX and the calculation results for those stats in the right column "Values". This should be updated with each click of a radio button. So if you were originally looking at :height, but wanted to look at :weight, you'd select :weight and then click on one of the radio buttons to get the relevant statistical summary. I tried following the Set Function example shown here, but have been unsuccessful (I do not know the Set Function call very well).

The Expr() for the MathA was intended to be called by closing the original window and opening a new one with the results, but after doing some more research in the JMP Discussions, I found that one can update fields within an existing window, which is how I prefer to approach this problem. So, I know that original coding at the top of my code is not the right code for what I intend to do.
Any help on this is much appreciated.
Thanks!,
DS