Showing posts with label jmp 8. Show all posts
Showing posts with label jmp 8. Show all posts

Friday, June 22, 2012

Quincunx using JMP's JSL: Basic Statistical Concepts of Center, Spread, Shape, and Stability

I had a new job and it's now harder for me to find time to update this blog or to even write JMP Scripts. While I enjoy my new function a lot, I from time to time miss writing scripts so badly that I just spend a few hours sitting down to design a function and then crudely write the JSL that will execute it. This one I'm sharing to the world hoping that I will comeback to me improved (and still free of charge, I hope).
I would really appreciate it if you would have the chance to use it that you would somehow mention the source and my name.
Here you go, a quincunx version in JMP (written in JMP 8, please don't run using JMP 7, the reports are messed-up on that version.):


//===================================
Clear Globals();
/************************************** DECLARE VARIABLES****************************/
//////////////////////////////////////////////////////////////////////////////////////
samples = 1000;
jval = 20;
kval = 5;
a = -kval;
b = jval;
droppoint = 0;
val = droppoint ;
x = 1;
y = 0;
SUM_BOUNCE = 0;
looping = 1;
PIN_LEVELS = jval;
PIN_WIDTH = kval * 2 - 1;
SAMPLES = samples;
m = 1;
n = 1;
o = 1;
loop2 = 0;
/********************************EXPRESSION******************************************/
//////////////////////////////////////////////////////////////////////////////////////
dist_com = Expr(
 dist = tb << Distribution(
  Stack( 1 ),
  Continuous Distribution(
   Column( :VALUE ),
   Quantiles( 0 ),
   Moments( 0 ),
   Horizontal Layout( 1 ),
   Vertical( 0 ),
   Outlier Box Plot( 0 )
  ),
  SendToReport(
   Dispatch( {"VALUE"}, "1", ScaleBox, {Min( -6 ), Max( 6 )} ),
   Dispatch(
    {"VALUE"},
    "Distrib Histogram",
    FrameBox,
    {Frame Size( 500, 200 ), DispatchSeg(
     HistSeg( 1 ),
     {Fill Color( "Medium Dark Green" ), Histogram Color( 20 )}
    )}
   )
  )
 );
 dist << minimize window;
 CC = Control Chart(
 Sample Label( Empty() ),
 Group Size( 1 ),
 KSigma( 3 ),
 Chart Col( :VALUE, Individual Measurement ),
 SendToReport(
  Dispatch( {}, "Control Chart", OutlineBox, Set Title( "Consistency" ) ),
  Dispatch(
   {},
   "Individual Measurement of VALUE",
   OutlineBox,
   Set Title( "Position" )
  ),
  Dispatch(
   {"Individual Measurement of VALUE"},
   "2",
   ScaleBox,
   {Format( "Fixed Dec", 12, 1 ), Min( -10 ), Max( 10 )}
  ),
  Dispatch(
   {"Individual Measurement of VALUE"},
   "1",
   ScaleBox,
   {Min( 0 ), Max( 1000 ), Inc( 5 ), Rotated Labels( 1 )}
  ),
  Dispatch(
   {"Individual Measurement of VALUE"},
   "IR Chart",
   FrameBox,
   Frame Size( 500, 200 )
  ),
  Dispatch(
   {"Individual Measurement of VALUE"},
   "IR Chart",
   FrameBox( 2 ),
   Frame Size( 70, 200 )
  )
 )
);
 CC << minimize window;
 CCR = CC << report;

 distr = dist << report;
 cc << minimize window;
 dist<< minimize window;
 wind << Show Window;

 wind[List Box( 4 )] << append( distr[framebox( 1 )] );
 wind[List Box( 4 )] << append( ccr[framebox( 1 )] );
 CC< dist< wind << Show Window;
);


/************************************** CREATE TABLE*********************************/
//////////////////////////////////////////////////////////////////////////////////////
tb = New Table( "BOUNCE RECORD", Add Rows( SAMPLES ) );
tb << minimize window();

For( m = 1, m <= PIN_LEVELS - 2, m++,
 tb << New Column( "PIN" || Char( m ), Nominal )
);
col = Column( 1 ) << set name( "VALUE" );
col << get name;
/************************************** CREATE WINDOW********************************/
//////////////////////////////////////////////////////////////////////////////////////

wind = New Window( "Basic Statistics Concept",
 VL = V List Box(
  Graph Box(
   title( "Center, Spread, Shape, Consistency" ),
   X Scale( -kval - 1, kval + 1 ),
   Y Scale( 0, jval ),
   framesize( 500, 200 ),
   Handle(droppoint ,jval,wait(2);droppoint = x; val = droppoint );
   Fill Color( "RED" ),          

   For( b = 0, b <= jval - 1, b++,
    For( a = -kval, a <= kval, a++,
     If(
      Mod( b, 2 ) == 1, Circle( {a + 0.5, b}, .1, "FILL" ),
      Circle( {a, b}, .1, "FILL" ),
     )
    )
   ),          
   Fill Color( "GREEN" ),
   r = Circle( {val, jval - y - 0.9}, .5, "FILL" )
  )





 )
);
//976,8000
////48,468

/************************************ EXTRA FUNCTIONS********************************/
//////////////////////////////////////////////////////////////////////////////////////
wind[axisbox( 1 )] << delete;
Wait( 0.1 );
loop = 0;
For( loop = 0, loop <= samples, loop++,
 x = 1;
 y = 0;
 If( loop == 1,
  Wait( 0 );
  Eval( dist_com );
 ,
  If( loop > 1,
   //dist << close window;
   //cc << close window;
   wind[framebox( 3 )] << delete;
   wind[framebox( 2 )] << delete;
   Eval( dist_com );

  )

 );
 wind << Show Window;
 For( y = 0, y < jval - 2, y++,        

  Wait( 0.05 );
  wind << reshow;
  rand = Random Binomial( 1, 0.5 );

  If( rand == 0,
   val = val + 0.5,
   val = val - 0.5
  );

  valbounce = If( rand == 0, -1, 1 );
  Column( y + 2 )[loop + 1] = valbounce;
  SUM_BOUNCE = SUM_BOUNCE + (valbounce / 2);
 );
 Column( 1 )[loop + 1] = SUM_BOUNCE;
 loop2 = 0;
 //wind[framebox(2)]< val = 0;
 drop = SUM_BOUNCE;
 wind << reshow();
 SUM_BOUNCE = 0;
 

);


//==================================

Friday, September 11, 2009

Capability Analysis in JMP

I received a note asking how to do a capability analysis in JMP 8. Actually nothing much have changed in how to do it. There are additional features which are really helpful but the basic steps on computing Cp, Cpk, Pp, and Ppk are basically shared by versions JMP 5, JMP 6, JMP 7, and JMP 8. Here are the detailed steps. I will be using JMP 8's sample data 'Semiconductor Capability.jmp'.

Capability Analysis in JMP

Method1
Step1: Data Requirements
Data should be in one column and data type set as continuous.
Step2: Go to Univariate Platform
Create a histogram of your measurement data as shown below.
Step3: Click on the second hot button
It is the red triangle as shown below. On the drop down menu, select 'Capability Analysis'
Step4: Specification Limits
On the resulting dialog box, fill up the necessary information regarding the specification limits and target values. In this case they are 104.41295,118.15322, and 131.89349. For Pp and Ppk, check on the tick box 'Long Term Sigma'. For Cp and Cpk, select either on the tick box 'Moving Range...' and specify the range span, or on the tick box 'Short Term Sigma...'. Note that whichever you choose JMP would use the terms Cp and Cpk in its output. It would specify in the title box of the output though the Sigma your analysis is referring to.
Step5: Capability Analysis Output
After pressing 'OK', JMP will give you this output.

Method2:
Step1: Data Requirements
Same as above
Step2: Set up the column that contains your data
Right click on the column header to see the following menu. Select 'Column Info'.
Step3: Column Properties
On the drop down menu 'Column Properties', select 'Spec Limits'.
Step4:Specification Limits
Fill up the necessary information regarding the specification limits and target values. In this case they are 104.41295,118.15322, and 131.89349, and then click 'OK'. Notice on the left side of your data table, and asterisk (*) sign is placed beside the column name where you just set up the specification limits.
Step5: Go to Univariate Platform
Create a histogram of your measurement data as shown below. Capability Analysis using Long Term Sigma is included by default.

Additional Features:
One of the reasons why I favor JMP over Minitab is its animated graphics. In JMP 8, Capability Analysis includes a feature called 'Capability Animation. To use this, click on the hot button as shown below.
The output window is like the one shown below.You can change the sigma to see its impact on the capability measures. For a JMP script like this where you can change the mean as well, refer to this entry or this entry.

 
Custom Search