cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
ytwu
Level I

JMP Script question: How to use variables to control "show group means"?

Hi all:
I have a question about Variability chart.

I am trying to use a variable "aaa" to control if the a certain variability chart need group means.
Below is the simplified code:
According to the log file, it seems that jmp does not substitute aaa to 0 so that it still plot group means even if
aaa=0.
Is there any way to let jmp to realize aaa is a variable?
Note: The values of aaa could be 0, 1 or "Split1"
Thanks


Code:

aaa = 0;
Variability Chart(
	Y(:Name("DIMPLE LG (NM)")), 
	X(:LOT, :DIMPLE LG), 
	Show Group Means(aaa)
);
1 REPLY 1
jthi
Super User

Re: JMP Script question: How to use variables to control "show group means"?

Eval(EvalExpr()) usually works in situations like this

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp");

show_means = 0;

Eval(EvalExpr(
	varchart = dt << Variability Chart(
		Y(:Measurement), 
		X(:Operator, :part#),
		Show Group Means(Expr(show_means))
	);	
));
-Jarmo