BookmarkSubscribe
Choose Language Hide Translation Bar
mochar
New Contributor

Exclude data points from some charts but not data file

I have a data set where I have conditions, and different measurements taken. 

 

For example:

Sex       Age       Height       Shoe size

Male      20          66 in.         10

Female  18          60 in.          8

 

I am making a script to view distribution, and variation. I would like to make graphs for height, and shoe size(seperately). In some instances  I have some height outliers (let's assume), but the shoe size is still valid. What line of code would I have to add to my scripts, to not include the outlier rows in one of my scripts... but include it in my other script? If I use hide/exclude, it disappears completely and doesn't show up in any graphs. I would like to have control to which graphs show which rows. I am using the Variability Gauge Chart and Distribution Charts.

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
ron_horne
Super User

Re: Exclude data points from some charts but not data file

Hi @mochar 

there are at least two ways to do what you are looking for.

first, you can use a "local data filter" separately for the graphs you want to filter. this will not affect the other plots.

the other option is manipulating the "timing" of the execution by using and not using "automatic recalc".

have a look at this script and let us know if it helps.

 

names default to here (1);
Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Big Class - Variability Chart of height, weight by sex",
	h list box (V List Box(
		Variability Chart(
			Automatic Recalc( 1 ),
			Y( :height ),
			X( :sex ),
			Model( "Main Effect" ),
			Variability Summary Report( 1 ),
			Points Jittered( 1 )
		),
		Variability Chart(
			Automatic Recalc( 1 ),
			Y( :weight ),
			X( :sex ),
			Variability Summary Report( 1 ),
			Mean of Std Dev( 1 ),
			Points Jittered( 1 )
		)
	),
	Distribution(
	Automatic Recalc( 1 ),
	Continuous Distribution( Column( :height ) ),
	Continuous Distribution( Column( :weight ) ),
	Local Data Filter(
		Add Filter(
			columns( :height, :weight ),
			Where( :height >= 55 & :height <= 70 ),
			Where( :weight >= 64 & :weight <= 160 )
		)
	)
),
));
1 REPLY 1
ron_horne
Super User

Re: Exclude data points from some charts but not data file

Hi @mochar 

there are at least two ways to do what you are looking for.

first, you can use a "local data filter" separately for the graphs you want to filter. this will not affect the other plots.

the other option is manipulating the "timing" of the execution by using and not using "automatic recalc".

have a look at this script and let us know if it helps.

 

names default to here (1);
Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "Big Class - Variability Chart of height, weight by sex",
	h list box (V List Box(
		Variability Chart(
			Automatic Recalc( 1 ),
			Y( :height ),
			X( :sex ),
			Model( "Main Effect" ),
			Variability Summary Report( 1 ),
			Points Jittered( 1 )
		),
		Variability Chart(
			Automatic Recalc( 1 ),
			Y( :weight ),
			X( :sex ),
			Variability Summary Report( 1 ),
			Mean of Std Dev( 1 ),
			Points Jittered( 1 )
		)
	),
	Distribution(
	Automatic Recalc( 1 ),
	Continuous Distribution( Column( :height ) ),
	Continuous Distribution( Column( :weight ) ),
	Local Data Filter(
		Add Filter(
			columns( :height, :weight ),
			Where( :height >= 55 & :height <= 70 ),
			Where( :weight >= 64 & :weight <= 160 )
		)
	)
),
));