Set spec limits for K sigma macroI use the "Distribution" platform along with "Set Spec Limits for KSigma" alot for getting suggested spec limits for non-normal data. Workflow is Distribution->assign a distribution->process capability in the distribution out put-> Set Spec limits for K Sigma. This can become a long process when you have lots of columns.
Ideally I'd be able to assign the right distribution and then have a macro that would loop through each column and make the "Set Limit..." output. I see that there is an example script for this functionality but it has a hard coded distribution and it also appears to only apply it to all columns.
It appears my first hurdle, which seems silly, is trying to get the assigned distribution from in the distribution platform so I can replace the hard coding of it (LogNormal in this example):
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = Distribution( Column( :CO ) );
obj << Fit Distribution( LogNormal( Set Spec Limits for KSigma( 3 ) ) );
I was thinking of using something like current report()["Distributions"]<< get scriptable object;
to be able use the code for the open distribution analysis and then I have to figure out how to loop through the columns in the open distribution.
The other option I was thinking about was assigning the distributions as a column property and pulling from that and running a bunch of individual analysis but I didn't see code to go that route either.
Thanks for any ideas!!
Steve
ScriptingRe: Set spec limits for K sigma macro"Show tree structure" May help you to adress the proper Position in the report.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = Distribution( Column( :CO ) );
obj << Fit Distribution( LogNormal( Set Spec Limits for KSigma( 3 ) ) );
obj << show tree structure;
Re: Set spec limits for K sigma macroIf you only have one fit per response, you can use the following:
obj<<(Fit Handle[1]<<( Set Spec Limits for KSigma( 3 ) ) );
Re: Set spec limits for K sigma macroThanks Tonya!
That works really well. However, it only appears to work if I have one column in the Distribution Analysis. Is there something I need to change to have it work when I have multiple columns in the analysis? If I have more than one it doesn't work; no error but also nothing happens.
The script from the sample library will run with multiple columns (though it is a hard coded distribution choice).
Steve
Re: Set spec limits for K sigma macroIt worked for me with multiple columns.
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
obj = Distribution( Column( :CO, :POP ) );
obj << Fit Distribution( exponential ) ;
obj<<(Fit Handle[1]<<( Set Spec Limits for KSigma( 3 ) ) );