Iterate over elements of reportHi, I'm new using JMP but I find it very useful and practical, so far I'm enjoying it a lot. I’m learning JSL because I need to automatize some of the analysis for my teammates and for efficiency. I am starting with something simple but I need help to move forward.
I need to customize the results of the distribution platform to perform a test of normality for several columns of a table, in order to repeat it as often as I or my colleagues need it. I managed to write a simple script that achieves this in an easy way. However I am having problems on how to edit particular elements of the report when a condition meet.
Here is the script that return values from the Shapiro-Wilk test:
// Select variables to analyze
Names Default to Here( 1 );
dt = Current Data Table();
dialog = New Window( "Select Columns", << Modal,
Panel Box( "Column Selection",
Lineup Box( N Col( 1 ),
Text Box( "Select columns for distribution" ),
y col list = Col List Box( All )
)
),
H List Box(
Button Box( "OK",
y col = y col list << Get Selected;
),
Button Box( "Cancel" )
)
);
If( dialog["Button"] == -1,
Throw( "User cancelled" )
);
// Create distribution
dist = dt << Distribution(Columns(evalList(y col)),Histograms Only);
// Add parameters
dist << Normal Quantile Plot( 1 );
dist << Fit Distribution(Normal(Goodness of Fit(1)));
How can I make JMP to automatically show customized summary statistics (inluding Skewness and Kurtosis) when the P value (Prob
When I try to edit something on the report, for example, remove the parameter estimates
distr["Parameter Estimates"] << Delete;
It does it only for the first element of the report.
I would appreciate any help on how to manipulate elements of the report, in general such as remove all the parameter estimates, and in particular such as P < 0.05.
Thanks!
Mass CustomizationRe: Iterate over elements of reportThanks!!!Re: Iterate over elements of reportThe H List Box() is just a container in the report window. JMP report windows can be thought of as collection of nested display containers and display elements in those containers. If you want to see the display tree structure with the display containers, right click on the grey triangle next to an Outline box and select Edit > Show Tree Structure.

In this case, I don't think you can do it in the reverse way, as you describe, as one of the results of running an analysis platform script command is that it creates the display window, and the <
If you don't place dist into the display tree as I did in the script, it will just create a new window with that single distribution analysis in it, and there will be a separate window with each distribution analysis (for each column selected).
Re: Iterate over elements of reportThank you very much, it fulfills its function and also teaches me a lot. It is a great help.
I'd like to ask you something to help my understanding, I hope it won't be much of a problem for you: I noticed that first step you took in the for loop was to append the distribution to the hb variable and afterwards you add all the details (qq-plot, SW test, etc.). Under my logic and experience programing, I usually would add the details first and then append everything to the right place (that's exactly where I was having the trouble actually). My question is, how does it work the hb created by the function New Window? Is it some kind of white page where it will be adding all the subsequent commands and adjusting the size of the new window accordingly? Will it append everything that has to do with the variable dist? And how does the new variable created with distr = Report( dist ) influences what is being appended?
About your comment on the goodness of fit test, thank you very much, that is actually the reason why I am creating the script. I just started a new job a month ago and so far my teammates have been using ONLY the p value from the Shapiro-Wilk test to accept or reject normal distribution. I am trying to provide them with more tools to understand or evaluate if the data follows a normal distribution or not, and why.
Re: Iterate over elements of reportWhen you use Distribution() with a list of columns, the report window contains the output from many 'independent' distribution analysis. Each one of those analysis is a separate object. Interacting with those objects can be different than interacting with the report layer in the report window When you do
dist << Normal Quantile Plot(1);
that message is broadcast to all of the distribution objects that are being displayed in the report window. But when you do
distr=Report(dist);
distr["Parameter Estimates"] << Delete;
what JMP does is to go to the first instance of the report layer object that can be referenced using the "Parameter Estimates" string, which in this case is the Outline Box under the Fitted Normal results. To do what you want to do, you would need iterate through each part of the report, get the result for the Shapiro-Wilk test from the report layer, and then decide to delete parts of the output report.
I think in your case it would be easier to iterate the distribution analysis for each column one at a time, appending the results to a new report window. Here is some example code that shows how to do that
// Select variables to analyze
Names Default To Here( 1 );
dt = Current Data Table();
dialog = New Window( "Select Columns",
<<MODAL></MODAL>