cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Jackie_
Level VI

Determine best fit and re-organize boxes and tables

Hi,

 

Is there a jsl way to identify the best fit for a particular parameter, generate capability analysis tables only for that model fit and then re-organize the display boxes only for the best fit in a new window (pictured below)? Also, can I maintain the functions?

Jackie__0-1708110824208.png

 


Here is what I tried: It works to an extend....

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
dis = Distribution(
	Continuous Distribution(
		Column( :NPN1 ),
		Quantiles( 0 ),
		Vertical( 0 ),
		Outlier Box Plot( 1 ),
		Fit Normal( Show Fit( 0 ), Process Capability( LSL( 104.41 ), Target( . ), USL( 131.89 ), Show as Graph Reference Lines ) ),
		Fit Johnson( Show Fit( 0 ) ),
		Fit Cauchy( Show Fit( 0 ) ),
		Fit Student's t( Show Fit( 0 ) ),
		Fit SHASH( Show Fit( 0 ) ),
		Fit Normal 2 Mixture( Show Fit( 0 ) ),
		Fit Normal 3 Mixture(
			Process Capability( LSL( 104.41 ), Target( . ), USL( 131.89 ), Show as Graph Reference Lines, Show Within Capability( 0 ) )
		),
		Customize Summary Statistics( Std Err Mean( 0 ), Upper Mean Confidence Interval( 0 ), Lower Mean Confidence Interval( 0 ), N Missing( 0 ) )
	)
);


New Window( "",
	Show Menu( 0 ),
	show toolbars( 0 ),
	H List Box(
		Panel Box( , 
			
			Report( dis )["NPN1", List Box( 3 )]
	
		), 
		
		V List Box(
			Spacer Box( size( 0, 10 ) ),
			Report( dis )["NPN1", "Summary Statistics"],
			Spacer Box( size( 0, 10 ) ),
			Report( dis )["NPN1", "Fitted Normal 3 Mixture Distribution", "Process Capability", "NPN1(Mixture of 3 Normals) Capability",
			"Overall Sigma Capability"],
			Spacer Box( size( 0, 10 ) ),
			Report( dis )["NPN1", "Fitted Normal 3 Mixture Distribution", "Process Capability", "NPN1(Mixture of 3 Normals) Capability",
			"Nonconformance"]
			
		)
	),
	Panel Box( ,
		Table Box(
			Report( dis )["NPN1", "Compare Distributions"]

		)
	)
);
dis << close window;

 

 

1 REPLY 1
jthi
Super User

Re: Determine best fit and re-organize boxes and tables

You can get "best fit" by sending message << Fit All to distribution and getting the first row from table box BUT this should be used just for exploratory analysis (good discussion here Scripting - How to select best fit distribution and collect capability parameters? ). You could then either collect those to Associative array where key is the column name and value distribution or set those to Distribution column property. Finally create your final plots using the platform which you wish to use.

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");

get_best_dist = function({dt, colname}, {Default Local},
	dist = dt << Distribution(
		Continuous Distribution(
			Column(Eval(colname)),
			Process Capability(0)
		),
		Invisible,
		Histograms Only
	);
	dist << Fit All;
	scb = Report(dist)[Outline Box("Compare Distributions"), Table Box(1), StringColBox(1)];
	bestdist = scb[1];
	dist << close window;
	
	return(bestdist);
);

aa_dist = Associative Array();
colrefs = dt << Get Column Group("Processes");
For Each({colref}, colrefs,
	Try(
		colname = colref << get name;
		curdist = get_best_dist(dt, colname);
		aa_dist[colname] = curdist;
		Eval(EvalExpr(Column(dt, colname) << Set Property("Distribution", Expr(curdist))));
	,
		show(colref);
	);
);
-Jarmo