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

Principal Component Filter Script

Hello, 

 

I noticed that there is no way to filter through principal components when looking at only a score plot in JMP. However, when using the 'summary' function in JMP there is a filter for looking through these principal components (please see highlighted in photo). 

MikeDereviankin_0-1598478221832.png

I was looking through the script and it seems as if the score plot is simply using the the summary plot script, but removing for all the other components except for the score plot. 

Estimation Method( "Default" ),
	"on Correlations",
	Summary Plots( 0 ),
	Score Plot( 2 ),
	SendToReport(
		Dispatch(
			{"Score Plot"},
			"101",
			ScaleBox,
			{Format( "Fixed Dec", 12, 1 ), Min( -7.65511111111111 ),
			Max( 6.12868740740741 ), Inc( 2.5 ), Minor Ticks( 0 )}
		),
		Dispatch(
			{"Score Plot"},
			"100",
			ScaleBox,
			{Min( -9.25066666666667 ), Max( 17.0666666666667 ), Inc( 5 ),
			Minor Ticks( 0 )}
		)
	)
)

 

 

I am creating a dashboard and only need the score plot with that principal component filter. Is there anyway to add that principal component filter to the script? 

Thanks! 

 

 

 

 

1 REPLY 1
Highlighted
ih
ih
Level VII

Re: Principal Component Filter Script

If you are trying to stay within the PCA platform you could use the Summary Plots section and just hide the other items.  One potential downside to this method is any customization the user made to their instance of JMP could lead to unwanted effects on your report.  For example, the user might have the loading matrix automatically open when they run a PCA.

 

Here is one method to hide the other elements:

names default to here(1);

dt = Open("$Sample_data/iris.jmp");

pc = dt << Principal Components(
	Y( :Sepal length, :Sepal width, :Petal length, :Petal width ),
	Estimation Method( "Default" ),
	"on Correlations"
);

//Hide the unwanted elements - there is a lot to take in here, see
// pc << Get XML and use web searches for xpath to learn more.
(pc << XPath( "//TableBox" )) << Visibility(Collapse);
(pc << XPath( "//BorderBox[PictureBox]" ))[2] << Visibility(Collapse);
(pc << XPath( "//BorderBox[CheckBoxBox]" )) << Visibility(Collapse);

Another option might be to export the scores as columns and then generate the plot using graph builder and either column switchers or a couple combo boxes with a script to delete and recreate the chart.

Article Labels