Hello everyone!!!, a question:What graph in JMP can answer the probabilities of obtaining a value or range of response, for example like the following graph.
Greetings,
Marco
Then what you need is just a Local Data Filter - and a Filter Change Handler that updates the results in the probabilities panel.The advantage: With the Data Filter it doesn't matter how many questions you will ask - just add as many selections as you want and the corresponding probabilities will show up automatically:
/*""" https://community.jmp.com/t5/Discussions/Can-JMP-show-the-probability-of-1-result-or-range-through-a/m-p/697164/highlight/true#M88257 Author: hogi Date: 2023-11-12 NB: back again at simple Data Filter */ Names Default To Here( 1 ); convertToList = Function( {myExpr}, myHead = Head( Name Expr( myExpr ) ); Substitute( Name Expr( myExpr ), Name Expr( myHead ), Expr( List() ) ); ); findArgs = Function( {myList, myHead}, {NArgs, myArg}, matches = {}; NArgs = N Arg( myList ); For Each( {i}, 1 :: NArgs, myArg = Arg( Name Expr( myList ), i ); If( Head( Name Expr( myArg ) ) == Name Expr( myHead ), Insert Into( matches, convertToList( Name Expr( myArg ) ) ) ); ); matches; ); all Cols = Current Data Table() << get column references(); New Window( "probabilites", H List Box( Current Data Table() << data filter( Local,Title("Selection"), Show Controls( 0 ), Show Modes( 0 ), Show Counts( 0 ), Conditional( 0 ), columns( Name Expr( all Cols ) ) ), hlb = H List Box() ) ); ldf = ((Current Report()["Selection"]) << get scriptable object); update = Function( {a}, {ldflist,filterExpr,myCols,myFilters,lookupTable,myValue}, ldf = ((Current Report()["Selection"]) << get scriptable object); ldflist = Convert To list( ldf << get script ); filterExpr = findArgs( ldflist, Expr( AddFilter() ) ); myCols = Transform Each({x},findArgs( Name Expr( filterExpr ), Expr( columns() )),x << get name) ; myFilters = findArgs( Name Expr( filterExpr ), Expr( Where() ) ); lookupTable = Associative Array( Transform Each( {x, i}, myFilters, Eval List( {If(Head(x)==Expr(And()),Arg( Arg(x,1), 1 )<< get name, Arg(x,1)<< get name) , i} ) ) ); myBox = Outline Box( "probabilities" ); For Each( {x}, myCols, Try( myPos = Eval(substitute(Expr(lookupTable[_x_]),Expr(_x_),Name Expr(x))); Eval( Substitute( Expr( sel_rows = Current Data Table() << get rows where( _match_ ); myValue = Char( Round( N Items(sel_rows) / N rows(current data table()) * 100, 2 ) ) || "%"; ), Expr( _match_ ), Name Expr( myFilters[myPos] ), ) ), myValue = "100%"); Insert Into( myBox, Panel Box( x, Text Box( myValue ) ) ); ); Try(result << delete); hlb << append( result = myBox ); ); rs = ldf << make filter change handler( update ); (Current Report() << xpath("//FrameBox")) << Frame Size( 500, 50 );
This code isn't good enough for me to turn it into an add-in (it would require at least one partial rewrite for me to consider it adequate), especially because I won't be updating it. If you wish to make it into an adding using Add-In Manager is the best option.
The script has been added as .zip file because it contains multiple files which must be in specific folders. After unpacking it
you should be able to open and run probability_calculator.jsl
Here is an alternative implementation which also allows "combined" filter conditions (A and B and C ...).
For this case it makes sense to enable the Conditional(1) setting - then additional filters will only show values that are within the range of the first filters.
In addition, one can create several filter "groups". Click on OR and a filter group N+1 is generated with the corresponding probability value. drawbacks:
if certainty ~ probabilty, the calculated values should be OK *)community feedback appreciated
The probabilities are calculated with the formula - line 55:
N Items( sel_rows ) / N Rows( Current Data Table() ) * 100
*) one restriction:
excluded rows are not handled separately. So, if you have such rows, delete them. Or adjust the equation.
https://community.jmp.com/t5/JMP-Wish-List/Formula-Editor-meaningful-results-with-excluded-rows/idi-p/589701
I don't know any easy way to do exactly what your example shows, but you can of course construct it manually using the quantiles from the Distribution platform. That platform also has an option to display the cdf, so that automatically shows the cumulative probabilities throughout the range. You can also add reference lines at any particular value you are interested in, and select rows less than that value and that part of the histogram will be highlighted. But beyond that I'm not aware of an automatic mechanism to produce your example. Perhaps someone else does or perhaps someone can write a script to do that.
Do you want the empirical result or one based on a model? Which JMP plot do you want to augment with this capability?
Hello Mark,
I'm glad to greet you, JMP seems like a great software to me and I think someone can achieve it.
Regarding your question: Do you want the empirical result or one based on a model? Which JMP plot do you want to augment with this capability?
1. The simulation result could generate a bar graph for each objective with the option of entering a value and knowing its % probability or entering a range and knowing its % probability or entering a % probability and knowing the probable value or enter a probable % range and know the probable value range.2. It should be based on a model, if possible in the Prediction Profiler
Greetings!
To some extent the profiler already does what you suggest. If your Y variable is nominal, the profiler will show the estimated probability for whatever set of X variables you choose. If you change the X variables, the estimated probability will adjust. If you are looking for a display that automatically builds a table showing probabilities as functions of X or a histogram (such as you displayed) that has you enter a value and has the area adjust, I believe that either requires someone to script that or you might suggest that as a wish for further development.
Hi @Marco1,
I think the Design Space Profiler may be helpful for what you intend to do. Based on Monte-Carlo simulations, and if you provide some specifications (Lower and/or Upper Specification Limits), the Design Space Profiler will calculate and display the in-spec rate, based on specific inputs ranges.
You can look at an example here and see if it corresponds to your needs : Example of Design Space Profiler.
I hope this answer will help you,
Victor
Interesting idea, but I'm not finding the Design Space Profiler. I ran a Fit model with a nominal Y variable and one continuous X variable and there is only the Profiler option at the red arrow and the red arrow for the Profiler does not list Design Space Profiler as an option (not even grayed out). Where do I find it?
1. Simulation
2. Model
In general, you might be thinking in terms of frequency, not probability.
Hi Dale,
I am happy to greet you, could you please show an example of your ingenious idea?
Hello Victor,
I am happy to greet you, the alternative you show is an interesting way to solve the problem, I will review it. Thank you!
Sorry for not letting me understand... although it may be the translator (Spanish-English), my question is... if it is possible that JMP, after a simulation using a bar graph, can answer:
The value in the certainty field changes to reflect the probability of an income level for a range from positive US$0 to positive infinity, that is, the chance of achieving a profit (profit greater than or equal to US$0) is approximately 93.20 %
This graph shows all the possible results, that is, in an investment there is the possibility of losing US$ 14.7 million until winning US 34.4 million and the certainty field shows 100% since the initial range of certainty includes all possible values.
Question 1: What is the probability of not losing money or the income being US$0?Answer 1: 79.80% or 20.20% to lose (100 minus 79.80)
Question 2: What is the probability of achieving a minimum profit of US$ 2 million?Answer 2: 73.60%
Question 3: What is the probability of achieving a minimum profit of US$ 4 million?Answer 3: 66.00%