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
WoHNY
Level III

JMP16 Generate Loop to Run Repeating Charts

I attached a sample data set and script for reference. I want to generate multiple Normal Quantile distribution charts based upon a set of categorical variables in Col2. In this case there are 16 unique variables in Col2 but that could vary. Currently I am subsetting the data for categorical variable from Col2, then generating the Normal Quantile distribution chart. I just repeat this process for the remaining unique categorical variables from Col2.

 

I would like to setup a basic loop to handle this iteration through the unique categorical variables in Col2 and generate the associated Normal Quantile distribution.

2 ACCEPTED SOLUTIONS

Accepted Solutions
jthi
Super User

Re: JMP16 Generate Loop to Run Repeating Charts

What are you going to do with those charts 16 reports (and then 17 tables you will have open)? I'm asking because Local Data Filter could be one option depending on what you are trying to do

jthi_0-1676560201846.png

Oneway(
	Y(:Col3),
	X(:Col4),
	Plot Quantile by Actual(1),
	Line of Fit(0),
	Normal Quantile Label(0),
	Local Data Filter(
		Add Filter(
			columns(:Col2),
			Where(:Col2 == "V2_0"),
			Display(:Col2, N Items(15))
		)
	),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Label Row({Show Major Grid(1), Show Minor Grid(1)})}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"1",
			ScaleBox,
			{Label Row({Show Major Grid(1), Show Minor Grid(1)})}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"2",
			ScaleBox,
			{Min(0.000347463516330788), Max(0.999652536483669), Inc(0.1),
			Minor Ticks(0), Add Ref Line(0.5, "Dashed", "Black", "", 1)}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"Oneway QuantilePlot",
			FrameBox,
			{Marker Size(1), Marker Drawing Mode("Normal")}
		)
	)
)

Other simple solution might be using By

jthi_1-1676560335675.png

After exploring those options I would start thinking about looping if needed.

-Jarmo

View solution in original post

WoHNY
Level III

Re: JMP16 Generate Loop to Run Repeating Charts

Thank you for the response. As I often say, if it was a snake it would have bit me! It was staring me right on the face for this one. Thanks for highlighting the "By" field for this case. I also have a question about the Graph > Graph Builder path for box plots if I don't want to utilize the Page option but run individual charts but I'll open another question for that. Thanks again.

View solution in original post

3 REPLIES 3
jthi
Super User

Re: JMP16 Generate Loop to Run Repeating Charts

What are you going to do with those charts 16 reports (and then 17 tables you will have open)? I'm asking because Local Data Filter could be one option depending on what you are trying to do

jthi_0-1676560201846.png

Oneway(
	Y(:Col3),
	X(:Col4),
	Plot Quantile by Actual(1),
	Line of Fit(0),
	Normal Quantile Label(0),
	Local Data Filter(
		Add Filter(
			columns(:Col2),
			Where(:Col2 == "V2_0"),
			Display(:Col2, N Items(15))
		)
	),
	SendToReport(
		Dispatch(
			{},
			"1",
			ScaleBox,
			{Label Row({Show Major Grid(1), Show Minor Grid(1)})}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"1",
			ScaleBox,
			{Label Row({Show Major Grid(1), Show Minor Grid(1)})}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"2",
			ScaleBox,
			{Min(0.000347463516330788), Max(0.999652536483669), Inc(0.1),
			Minor Ticks(0), Add Ref Line(0.5, "Dashed", "Black", "", 1)}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"Oneway QuantilePlot",
			FrameBox,
			{Marker Size(1), Marker Drawing Mode("Normal")}
		)
	)
)

Other simple solution might be using By

jthi_1-1676560335675.png

After exploring those options I would start thinking about looping if needed.

-Jarmo
txnelson
Super User

Re: JMP16 Generate Loop to Run Repeating Charts

I think that @jthi second solution, using a BY() variable is the first solution you should try.

Jim
WoHNY
Level III

Re: JMP16 Generate Loop to Run Repeating Charts

Thank you for the response. As I often say, if it was a snake it would have bit me! It was staring me right on the face for this one. Thanks for highlighting the "By" field for this case. I also have a question about the Graph > Graph Builder path for box plots if I don't want to utilize the Page option but run individual charts but I'll open another question for that. Thanks again.