cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Fabian88
Level I

Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Dear all,
I´m sure its an easy question - so for you I think its an quick and easy answer :)

I would like to calculate the data in the distribution-overview based on the selection:
Summary.JPG
Here for example I would like to see the summary statistics direct after selecting this data (new table calculation). For now I just can see this specific calculation if I Hide and Exclude the unneccesary data in the raw-data-table.

Is this possible?

Im looking forward to your answer. Thanks alot!
Fabian

2 ACCEPTED SOLUTIONS

Accepted Solutions
ian_jmp
Staff

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Perhaps you can use the local data filter?

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dist = dt << Distribution(
					Automatic Recalc( 1 ),
					Continuous Distribution( Column( :height ) ),
					Continuous Distribution( Column( :weight ) ),
					Local Data Filter(
						Add Filter(
							columns( :age, :sex ),
							Display( :age, Size( 160, 90 ), List Display )
						)
					)
				);

Alternatively, you could use a dashboard with a selection filter

View solution in original post

txnelson
Super User

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Or are you looking to click on the Male/Female distribution, and for it to change the values in the other graphs

Here is an example from the Scripting Index using a Data Filter Source Box

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			Data Filter Source Box(
				Graph Builder(
					Size( 208, 207 ),
					Show Control Panel( 0 ),
					Show Legend( 0 ),
					Variables( X( :age ) ),
					Elements( Bar( X, Legend( 3 ) ) ),
					SendToReport(
						Dispatch(
							{},
							"Graph Builder",
							OutlineBox,
							{Set Title( "Filter" )}
						)
					)
				)
			),
			Platform(
				Current Data Table(),
				Bubble Plot(
					X( :weight ),
					Y( :height ),
					Sizes( :age ),
					Title Position( 0, 0 )
				)
			)
		)
	)
);

f1.PNG

f2.PNG

Here is the code adapted to the example you gave

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			Data Filter Source Box( Distribution( Nominal Distribution( Column( :sex ) ) ) ),
			Platform(
				Current Data Table(),
				Distribution(
					Nominal Distribution( Column( :age ) ),
					Continuous Distribution( Column( :height ) ),
					Continuous Distribution( Column( :weight ) )
				)
			)
		)
	)
);

f3.PNG

Jim

View solution in original post

9 REPLIES 9
ron_horne
Super User (Alumni)

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

perhaps the following,

once you selected the subset go to Tables>>>subset and produce a subset with only the selected rows.

then, if you open the distribution platform and hit the recall button you should get what you are looking for.

 

Ron

 

Fabian88
Level I

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Hey ron,
Thank you for your fast response.
With your solution I have a distribution with just the subset-data. This solution is the same compared to "Hide and Exclude" the unneccesary data.
What I am looking for is the same distribution overview, and if i select a subset (e.g. M/F) i want the calculated data based just on this subset.

ian_jmp
Staff

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Perhaps you can use the local data filter?

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dist = dt << Distribution(
					Automatic Recalc( 1 ),
					Continuous Distribution( Column( :height ) ),
					Continuous Distribution( Column( :weight ) ),
					Local Data Filter(
						Add Filter(
							columns( :age, :sex ),
							Display( :age, Size( 160, 90 ), List Display )
						)
					)
				);

Alternatively, you could use a dashboard with a selection filter

txnelson
Super User

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Or are you looking to click on the Male/Female distribution, and for it to change the values in the other graphs

Here is an example from the Scripting Index using a Data Filter Source Box

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			Data Filter Source Box(
				Graph Builder(
					Size( 208, 207 ),
					Show Control Panel( 0 ),
					Show Legend( 0 ),
					Variables( X( :age ) ),
					Elements( Bar( X, Legend( 3 ) ) ),
					SendToReport(
						Dispatch(
							{},
							"Graph Builder",
							OutlineBox,
							{Set Title( "Filter" )}
						)
					)
				)
			),
			Platform(
				Current Data Table(),
				Bubble Plot(
					X( :weight ),
					Y( :height ),
					Sizes( :age ),
					Title Position( 0, 0 )
				)
			)
		)
	)
);

f1.PNG

f2.PNG

Here is the code adapted to the example you gave

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Selection Filter",
	Data Filter Context Box(
		H List Box(
			Data Filter Source Box( Distribution( Nominal Distribution( Column( :sex ) ) ) ),
			Platform(
				Current Data Table(),
				Distribution(
					Nominal Distribution( Column( :age ) ),
					Continuous Distribution( Column( :height ) ),
					Continuous Distribution( Column( :weight ) )
				)
			)
		)
	)
);

f3.PNG

Jim
Fabian88
Level I

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

@ian_jmp - thx. the local data filter is a good way to select the data!
@txnelson - I like your solution over the Data Filter Source Box as well.. i rebuild your solution by using your script! But can you show me the solution how i can set up this directly over the jmp software? This would be handy to show this to my College.
txnelson
Super User

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

I am not understanding what you are asking.

" But can you show me the solution how i can set up this directly over the jmp software?"

Could you provide more details?

Jim
Fabian88
Level I

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

Sry.. 
If i run your script based on my data,  I get the "Data Filter Context Box". If i select M I get the new graphs and as well the new calculated "Summary statistics". 
Thats excatly how i want it.
My last question here is: How can i set up this without using the script? Is there a solution which i can select in the jmp-software? I want to explain my collegue to set this up without using the script (we don´t have programming skills ;-)) 
Do you understand what I want? 

1.JPG2.JPG

txnelson
Super User

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

The Dashboard facility in JMP has a template that would allow you to setup such filtering..

     New==>Dashboard==>Hierarchical Filter

Jim
ian_jmp
Staff

Re: Distribution analysis (e.g. summarize statistics) direct calculation after selection?

One of the great things about Dashboard Builder is that you don't need any programming. JMP add-ins also make it easy to disseminate dashboards to others.

Just as an example, I made the add-in attached in 30 seconds, with no coding. If you double click on it to install, you can then go to the 'Add-Ins' menu and select 'Dashboard' to run it. It will look for file 'Big Class.jmp', which you can find in the sample data.