Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
anuragg
Level II

Graphs produced via for loop not appending to new window using VlistBox

Hello, 

 

1. I have the list of all column names in colNameList. 

2. I am trying to iterate through the dataset and only produce 2 different plots side by side (one way and variability) per column. 

3. Trying to append those plots for each column (16,17,18) to a window called temp at the end of each iteration. 

Final desired output :

New Window

   plot-1,plot-2  (for i=16)

   plot-3,plot-4 (for i=17)

   plot-5,plot-6 (for i=18)

 

Error that I am getting when I run the following code: deleted object reference: vlb<<append (H List Box(Eval(Eval Expr(vp)),Eval(Eval Expr(owp)))) in access or evaluation of 'Glue'

 

Please help to point what am I doing wrong. 

Thanks

colNameList=dt<<get column names
New window("Temp",vlb=V list Box());
current data table(dt);

For (i=16, i<18, i++, 
	vp=Expr(
Variability Chart(
	Y( Column(dt,colNameList[i]) ),
	X( :product, :Wafer Category ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	Show Box Plots( 1 ),
	SendToReport(
		Dispatch(
			{"Variability Chart for"|| colNameList[i]},
			"Variability Chart",
			FrameBox,
			{Frame Size( 309, 240 ), DispatchSeg(
				Box Plot Seg( 1 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 2 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 3 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 4 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 5 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 6 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 7 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 8 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			)}
		),
		Dispatch(
			{"Variability Chart for " || colNameList[i]},
			"",
			NomAxisBox,
			{Set Width( 309 ), Set Height( 93 )}
		),
		Dispatch(
			{"Variability Chart for " || colNameList[i]},
			"",
			NomAxisBox( 2 ),
			{Set Width( 309 ), Set Height( 98 )}
		)
	)
)
);
dt<<select where(:Wafer Category!="Baseline");

owp=Expr(
Oneway(
	Y( Column(dt,colNameList[i]) ),
	X( :Wafer Category ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0 ),
	Comparison Circles( 1 ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 ),
	SendToReport(
		Dispatch(
			{},
			"Oneway Analysis of "||colNameList[i]|| "By Wafer Category",
			OutlineBox,
			{Set Title( "ProbPlot" )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"1",
			ScaleBox,
			{Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"2",
			ScaleBox,
			{Format( "Best", 15 ), Add Ref Line( 0.5, "Solid", "Black", "", 1 ),
			Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"Oneway QuantilePlot",
			FrameBox,
			{Frame Size( 428, 369 ), Row Legend(
				Wafer Category,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Standard" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"",
			PlotColBox,
			{Visibility( "Collapse" )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"",
			StringColBox,
			{Visibility( "Collapse" )}
		)
	)
)
);
vlb<<append (H List Box(Eval(Eval Expr(vp)),
	           Eval(Eval Expr(owp))
	           ));
);
3 REPLIES 3
Highlighted

Re: Graphs produced via for loop not appending to new window using VlistBox

The first line is missing a semicolon - is that a copy/paste error?  The log might show additional error messages, but if the New Window() call did not execute, variable "vlb" may refer to a previously created box that has been deleted.

Highlighted
anuragg
Level II

Re: Graphs produced via for loop not appending to new window using VlistBox

Hi,

 

Thank you for your reply. It works now. It was dumb on my part to not validate it correctly. 

 

However, now I am running into a different issue. I made the variability plots and normal quantile plots so that the points on the graph appear highlighed and color coded according to the legend category but every legend category has turned into a blob of black dots. How can I fix this issue?

colNameList=dt<< Get Column Names();
vlb=V list Box();
j2=New Window("Plots",<<journal,vlb);
current data table(dt);

For (i=16, i<18, i++, 
vp=Expr(
Variability Chart(
	Y( Column(dt,colNameList[i]) ),
	X( :product, :Wafer Category ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Std Dev Chart( 0 ),
	Points Jittered( 1 ),
	Show Box Plots( 1 ),
	SendToReport(
		Dispatch(
			{"Variability Chart for"|| colNameList[i]},
			"Variability Chart",
			FrameBox,
			{Frame Size( 320, 250 ), DispatchSeg(
				Box Plot Seg( 1 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 2 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 3 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 4 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 5 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 6 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 7 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			), DispatchSeg(
				Box Plot Seg( 8 ),
				{Box Type( "Outlier" ), Line Color( "Red" )}
			)}
		),
		Dispatch(
			{"Variability Chart for " || colNameList[i]},
			"",
			NomAxisBox,
			{Set Width( 320 ), Set Height( 100 )}
		),
		Dispatch(
			{"Variability Chart for " || colNameList[i]},
			"",
			NomAxisBox( 2 ),
			{Set Width( 309 ), Set Height( 100 )}
		)
	)
)
);
dt<<select where(:Wafer Category!="Baseline");
owp=Expr(
Oneway(
	Y( Column(dt,colNameList[i]) ),
	X( :Wafer Category ),
	All Graphs( 0 ),
	Plot Quantile by Actual( 1 ),
	Line of Fit( 0 ),
	Comparison Circles( 1 ),
	X Axis Proportional( 0 ),
	Grand Mean( 0 ),
	SendToReport(
		Dispatch(
			{},
			"Oneway Analysis of "||colNameList[i]|| "By Wafer Category",
			OutlineBox,
			{Set Title( "ProbPlot" )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"1",
			ScaleBox,
			{Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"2",
			ScaleBox,
			{Format( "Best", 15 ), Add Ref Line( 0.5, "Solid", "Black", "", 1 ),
			Label Row( Label Orientation( "Vertical" ) )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"Oneway QuantilePlot",
			FrameBox,
			{Frame Size( 428, 369 ), Row Legend(
				Wafer Category,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Standard" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"",
			PlotColBox,
			{Visibility( "Collapse" )}
		),
		Dispatch(
			{"Normal Quantile Plot"},
			"",
			StringColBox,
			{Visibility( "Collapse" )}
		)
	)
)
);
vlb<<append (H List Box(Eval(Eval Expr(vp)),
	           Eval(Eval Expr(owp))
	           ));
);
 

example.png

Highlighted

Re: Graphs produced via for loop not appending to new window using VlistBox

I would suggest that you review the log for more errors in the execution of your script.  The SendToReport command does not evaluate all of the arguments by default.  You might be able to clear up some of those errors by forcing evaluation of the arguments, as in:

 

	Dispatch({Eval("Variability Chart for"|| Char(colNameList[i]))}, ...)

As an alternative, I generally prefer to modify reports after the creation.  SendToReport is very useful for preserving modifications when saving a script from a platform, but when writing a custom script there are other options.  If you save the variability platform to a variable called "vari", you can modify the report with something like the following:

 

(vari << Report)["Variability Chart for"|| Char(colNameList[i])][FrameBox(1)] << (messages...)
Article Labels