Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
mohammed1405
Level I

How can I get a color map on correlations in my script

Dear all,

I hope anyone can help me with my question. 

Actually, I am a new user in JMP and I have a script which is concerned to designs evaluation.

My question is how can I get a color map on correlation between main effects and their interaction in my code( I put my code bellow).

It is easy to see it from JMP window but I do not know which code should I add to show it in my script result.

Thank you for your cooperation. 

Medo

 

 

my script is:

dt2_5_2=New Table( "First Example",
	Add Rows( 13 ),
	New Column( "Column 1",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 1, 1, -1, 0, -1, 0, -1, -1, -1, 1, 0, 1] )
	),
New Column( "Column 2",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, -1, -1, -1, -1, 0, 0, -1, 1, 1, 1, 1, 0] )
	),
	New Column( "Column 3",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [-1, -1, 1, 0, -1, -1, 0, 1, 1, -1, 0, 1, 1] )
	),
	New Column( "Column 4",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [-1, 1, 0, -1, -1, 1, 0, 1, -1, 0, 1, 1, -1] )
	),
	New Column( "Column 5",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [0, -1, 1, -1, 1, 1, 0, 0, 1, -1, 1, -1, -1] )
	),
	New Column( "Column 6",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Set Values( [1, 0, 1, 1, -1, 1, 0, -1, 0, -1, -1, 1,-1] )
	),
	

	Set Row States( [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] )
);





Names Default To Here( 1 );

dt = Data Table( "First Example" );
cols = dt << getColumnNames;

D_eff = List();
G_eff = List();
A_eff = List();
PredVar = List();
Model1 =List();
Model2=List();


For( c1 = 1, c1 <= N Items( cols ), c1++,
	For( c2 = c1 + 1, c2 <= N Items( cols ), c2++,
		//For( c3 = c2 + 1, c3 <= N Items( cols ), c3++,
			//For( c4 = c3 + 1, c4 <= N Items( cols ), c4++,
				//For( c5 = c4 + 1, c5 <= N Items( cols ), c5++,
					//For( c6 = c5 + 1, c6 <= N Items( cols ), c6++, 
						dt2 = dt << Subset(
							Columns(
								cols[c1],
								cols[c2]
								//cols[c3]
								//cols[c4]
								//cols[c5]
								//cols[c6]
							)
						);
						
						//Get Evaluate Designs as Report Object
						rpt = (dt2 << Evaluate Design(
                            X( cols[c1], cols[c2] ),
							{Add Term( {1, 0} ), Add Term( {1, 1} ),
							Add Term( {2, 1} ), 
						        Add Term( {1, 1}, {2, 1} )}
						))<<Report;
						
						//Gets Reference to Design Diagnostics outline box
						Diagnostics = rpt["Design Diagnostics"]; 

						//Inserts design evaluation criteria into lists
						Insert Into(D_eff,(Diagnostics[Number Col Box(1)] << Get)[1]);
						Insert Into(G_eff,(Diagnostics[Number Col Box(2)] << Get)[1]);
						Insert Into(A_eff,(Diagnostics[Number Col Box(3)] << Get)[1]);
						Insert Into(PredVar,(Diagnostics[Number Col Box(4)] << Get)[1]);
						Insert Into(Model1,c1);

                        Insert Into(Model2,c2);

						rpt << Close Window(); //closes Evaluate Design window						
						Close( dt2, no save ); //closes current design subset table
					//)
				//)
			//)
		//)
	)
);

dt_out = New Table("Design Evaluation Criteria");
dt_out << Set Matrix(Transpose(Matrix(list(Model1,Model2,D_eff,G_eff, A_eff, PredVar))));

Column(dt_out,1) << Set Name("Col1");
Column(dt_out,2) << Set Name("Col2");
Column(dt_out,3) << Set Name("D Efficiency");
Column(dt_out,4) << Set Name("G Efficiency");
Column(dt_out,5) << Set Name("A Efficiency");
Column(dt_out,6) << Set Name("Average Prediction Variance");
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How can I get a color map on correlations in my script

Somewhere after you get the reference to the report layer and before you close the platform, send a message to the outline with the color map. For example, you might want the color map as a picture. So it would look like this;

 

Diagnostics = rpt["Design Diagnostics"];
color map = rpt["Color Map*"] << Get As Picture;
Learn it once, use it forever!

View solution in original post

2 REPLIES 2
Highlighted

Re: How can I get a color map on correlations in my script

Somewhere after you get the reference to the report layer and before you close the platform, send a message to the outline with the color map. For example, you might want the color map as a picture. So it would look like this;

 

Diagnostics = rpt["Design Diagnostics"];
color map = rpt["Color Map*"] << Get As Picture;
Learn it once, use it forever!

View solution in original post

Highlighted
mohammed1405
Level I

Re: How can I get a color map on correlations in my script

Dear markbailey
Thank you a lot for helpful solution that what I am looking for. 

 

Article Labels

    There are no labels assigned to this post.