cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Marco1
Level IV

Can JMP show the probability of 1 result or range through a graph?

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.

Marco1_0-1699317866245.png

Greetings,

Marco

 

57 REPLIES 57

Re: Can JMP show the probability of 1 result or range through a graph?

1. Simulation

  1. What do you mean by "for each objective?"
  2. Where will your simulation results be found? In a JMP data table?
  3. Can the histogram in Distribution be used, or do you prefer a histogram in Graph Builder?
  4. A value does not have a probability. It only has a density. The histogram you show above has 'bins' to count data occurring in a range. Do you mean the frequency in a bin when you ask for the probability of a value?
  5. The inverse operation is ill-defined on a histogram. 

2. Model

  1. What model do you use?
  2. What is the function that you want to profile with the Prediction Profiler?

 

In general, you might be thinking in terms of frequency, not probability.

Marco1
Level IV

Re: Can JMP show the probability of 1 result or range through a graph?

Hello Mark,

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:

Marco1_1-1699477628573.png

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 %

 

Marco1_2-1699478194060.png

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.

 

Marco1_3-1699478638553.png

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)

 

Marco1_4-1699479348201.png

Question 2: What is the probability of achieving a minimum profit of US$ 2 million?
Answer 2: 73.60%

 

Marco1_5-1699479512262.png

Question 3: What is the probability of achieving a minimum profit of US$ 4 million?
Answer 3: 66.00%

 

Greetings,

Marco

 

 

dale_lehman
Level VII

Re: Can JMP show the probability of 1 result or range through a graph?

I'm very familiar with the displays you are showing - they are regular outputs of Excel simulation programs.  I don't know of an automatic JMP capability that shows the same - but this will provide the same kind of information, though not quite the same display.  You can Analyze Distribution for any variable (it could be the prediction formula from a model or just a variable you have data on).  If you save the Probability Scores you get a column of the cumulative probabilities associated with the values of that variable - this is a new column in your data set.  You can then use Fit Y by X, with the probability scores as Y and the variable values as X.  This will reproduce the cumulative probability distribution.  Choose to show the histogram borders.

 

Now, if you highlight a portion of the histogram border for your X variable, the corresponding cumulative probability associated with that value will show up as the Y value.  You can interactively use this to "discover" the types of probabilities you show in your examples, albeit without the automatic graphs.  Perhaps somebody knows a way to script producing those graphs - but that is not my expertise.

Marco1
Level IV

Re: Can JMP show the probability of 1 result or range through a graph?

Hi Dale,

Ingenious solution!!!....surely someone with a command of scripting could create an add-in for JMP that calculates the certainty of a response or range, just like the examples I shared.

Greetings,

Marco

Jeff_Perkinson
Community Manager Community Manager

Re: Can JMP show the probability of 1 result or range through a graph?

I think what you're looking for is the Simulator in the Profiler. 

2023-11-09_15-51-18.508.png

2023-11-09_15-50-51.037.png

You learn more here:

Simulating Data Using the Prediction Profiler 

-Jeff
hogi
Level XII

Re: Can JMP show the probability of 1 result or range through a graph?

If you want to calculate the percentage of the selected part of a distribution, you can plot the distribution in Graph Builder and use a column formula to display the percentage.


Here I took the height distribution in students.jmp, but the same holds for some income, profit etc. 

 

 

Open( "$SAMPLE_DATA/Students.jmp" );

New Column( "percent",
	Formula(
		(Col Number( If( Selected(), :height, . ) ) / Col Number( :height )) * 100
	)
);
New Column( "one",Nominal, Set each value( 1 ));
:percent << Label( 1 ); // I forgot to add this to the script, thanks @Dale_lehman
Graph Builder(
	Size( 590, 393 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :height ), Y( :one ), Y( :height ) ),
	Relative Sizes( "Y", [59 231] ),
	Elements( Position( 1, 1 ), Heatmap( Y, Legend( 6 ), Label( "Label by Row" ) ) ),
	Elements( Position( 1, 2 ), Histogram( X, Y, Legend( 9 ) ) )
);
Marco1
Level IV

Re: Can JMP show the probability of 1 result or range through a graph?

Hello Hogi,

Nice to greet you, a great idea!! It is the closest thing to the examples I shared... I tried to do it but I couldn't, could you share an example of the process (start - end)?, thank you!

Greetings

Marco

hogi
Level XII

Re: Can JMP show the probability of 1 result or range through a graph?

The JSL code shows the individual steps.

Some steps are just "workarounds" and don't have an apparent  "goal"
(like the Heatmap plot to create a display area for the computed value - or the column "one" to get a single heatmap cell.

 

This video shows how to do it manually:

  • The histogram works as well without a value on the y axis
    - but you need a value on the y axis to add the second subplot on top. So just use any column you want (it will be ignored). 
  • percentage is created as a formula column - and is later used as "row" label for the heatmap plot to shoe the percentage in the plot.
    [I added the label tag already in the beginning - I forgot to add this part in the first version of the JSL code, Thanks @dale_lehman for highlighting.]
  • to create the display area for the percentage:
    - use a heatmap graph with just 1 cell:
    - to do so, use a column with constant value (1, or "X") - or disabling the Y variable
    - remove the X subgroups from the heatmap by disabling the X variable

Then the graph is ready. Just some cosmetics like adjusting the dimensions, bar widths and colors.

 

hogi
Level XII

Re: Can JMP show the probability of 1 result or range through a graph?

If you prefer a slider to select the range, you can use a data filter.

 

 

 

dt = Open( "$SAMPLE_DATA/Students.jmp" );

New Column( "percent",
	Formula( (Col Number( If( Selected(), :height, . ) ) / Col Number( :height )) * 100 )
);
New Window( "plot",
	V List Box(
		Graph Builder(
			Show Control Panel( 0 ),
			Show Legend( 0 ),
			Show Title( 0 ),
			Variables( X( :height ), Y( :height ), Y( :height ) ),
			Elements( Position( 1, 1 ), Heatmap( Label( "Label by Row" ) ) ),
			Elements( Position( 1, 2 ), Histogram( X, Y ) )
		),
		dt << Data Filter(
			Add Filter( columns( :height ) ),
			Title( "" ),
			Show Controls( 0 ),
			Show Modes( 0 ),
			Show Counts( 0 ),
			Show Histograms and Bars( 0 )
		)
	)
)
;
Marco1
Level IV

Re: Can JMP show the probability of 1 result or range through a graph?

Hello Hogi,

The option to use a filter is practical! The JTHI script is similar to the example I shared, it would be great if it were an add-in in JMP.

Greetings,

Marco