cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Abby_Collins14
Level III

Scripting Equivalence Test: Equivalence Test function not evaluating variance type from a list

Hello! 

 

Attached is a script that is automating equivalence testing in JMP on the example Auto Raw Data set (both script and data attached). My issue is line 27 of my script where I am specifying the variance type in the Equivalence test function. The equivalence test function is: 

 

tostv = {"Pooled Variance", "Unequal Variances"};
ksd = {12,275};

Equivalence Tests( ksd[i], 0.05, tostv[i], // ***need to fix "Equivalence", With Control( "Young" ) )

However the tostv[i] is not getting evaluated properly, it is being ignored and the default pooled variance is being used. I assume I need some type of combination of eval functions but I cannot get it to work. See attached data and script. Thanks for any help!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Scripting Equivalence Test: Equivalence Test function not evaluating variance type from a list

Below is a version of the script that will correctly handle the tostv list.  However, there is a logic problem with your "i" variable.  In your script, you are looping through your For loop 4 times, incrementing i by one each time, however you only have 2 levels of your tostv list.

 

Here is the code

Names Default To Here( 1 );

tostv = {"Pooled Variance", "Unequal Variances"};
ksd = {12, 275};

dt = Current Data Table();
cnames = dt << Get Column Names( string );
n = N Items( cnames );
i = 0;
anova = Fit Group(
	For( colnum = 4, colnum <= n, colnum++,
		i = i + 1;
		Eval(
			Eval Expr(
				Oneway(
					Y( Column( colnum ) ),
					X( :AgeClass ),
					All Pairs( 1 ),
					Means( 1 ),
					t Test( 1 ),
					Unequal Variances( 1 ),
					Std Dev Lines( 0 ),
					Mean Diamonds( 1 ),
					Connect Means( 1 ),
					Equivalence Tests(
						ksd[i],
						0.05,
						Expr( tostv[i] ),  //***need to fix to eval tostv
						"Equivalence",
						With Control( "Young" )
					),
					SendToReport(
						Dispatch( {}, "1", ScaleBox, {Minor Ticks( 0 )} ),
						Dispatch( {}, "Oneway Plot", FrameBox, ),
						Dispatch( {}, "Oneway Means Compare", FrameBox, ),
						Dispatch( {"Oneway Anova"}, "Summary of Fit", OutlineBox, {Close( 1 )} ),
						Dispatch( {"Oneway Anova"}, "Analysis of Variance", OutlineBox, {Close( 1 )} ),
						Dispatch( {"Oneway Anova"}, "Means for Oneway Anova", OutlineBox, {Close( 1 )} ),
						Dispatch( {}, "t Test", OutlineBox, {Close( 1 )} ),
						Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
					)
				)
			)
		);
	)
);
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Scripting Equivalence Test: Equivalence Test function not evaluating variance type from a list

Below is a version of the script that will correctly handle the tostv list.  However, there is a logic problem with your "i" variable.  In your script, you are looping through your For loop 4 times, incrementing i by one each time, however you only have 2 levels of your tostv list.

 

Here is the code

Names Default To Here( 1 );

tostv = {"Pooled Variance", "Unequal Variances"};
ksd = {12, 275};

dt = Current Data Table();
cnames = dt << Get Column Names( string );
n = N Items( cnames );
i = 0;
anova = Fit Group(
	For( colnum = 4, colnum <= n, colnum++,
		i = i + 1;
		Eval(
			Eval Expr(
				Oneway(
					Y( Column( colnum ) ),
					X( :AgeClass ),
					All Pairs( 1 ),
					Means( 1 ),
					t Test( 1 ),
					Unequal Variances( 1 ),
					Std Dev Lines( 0 ),
					Mean Diamonds( 1 ),
					Connect Means( 1 ),
					Equivalence Tests(
						ksd[i],
						0.05,
						Expr( tostv[i] ),  //***need to fix to eval tostv
						"Equivalence",
						With Control( "Young" )
					),
					SendToReport(
						Dispatch( {}, "1", ScaleBox, {Minor Ticks( 0 )} ),
						Dispatch( {}, "Oneway Plot", FrameBox, ),
						Dispatch( {}, "Oneway Means Compare", FrameBox, ),
						Dispatch( {"Oneway Anova"}, "Summary of Fit", OutlineBox, {Close( 1 )} ),
						Dispatch( {"Oneway Anova"}, "Analysis of Variance", OutlineBox, {Close( 1 )} ),
						Dispatch( {"Oneway Anova"}, "Means for Oneway Anova", OutlineBox, {Close( 1 )} ),
						Dispatch( {}, "t Test", OutlineBox, {Close( 1 )} ),
						Dispatch( {}, "Means Comparisons", OutlineBox, {Close( 1 )} )
					)
				)
			)
		);
	)
);
Jim
Abby_Collins14
Level III

Re: Scripting Equivalence Test: Equivalence Test function not evaluating variance type from a list

Thanks so much Jim! And thanks for the catching the i logic issue- my original data set had a tostv list of 4 levels opposed the to 2 in this example. 

 

I greatly appreciate your help with the eval functions!