Hello everyone,
I need some help in order to adapt my P' chart of Laney for events.
Below is my code:
Firstly, I need to determine a z_KSigmaZ
coefficient based on the Y1 column with these lines:
z_yyy = Eval( {: "Y1" } );
z_xx = z_yyy[1] << get values;
z_nnn = Eval( {:Nombre de seringues} );
z_nn = z_nnn[1] << get values;
z_rrr = Eval( {:Numéro de lot} );
z_Proportion = E Div( z_xx, z_nn );
z_Pbar = V Sum( z_xx ) / V Sum( z_nn );
z_sigma_est = Root( z_Pbar * (1 - z_Pbar) );
z_zvalue = E Mult( ((z_Proportion - z_Pbar) / z_sigma_est), Root( z_nn ) );
z_nr = N Row( z_zvalue );
z_mRList = {0};
z_m = z_zvalue;
z_m[1, 0] = [];
z_m = z_m |/ [0];
z_mr = Abs( z_m - z_zvalue );
z_nr = N Row( z_mr );
z_mr[z_nr, 0] = [];
z_SigmaZ = Mean( z_mr ) / 1.128;
z_KSigmaZ = 3 * z_SigmaZ;
then, I am creating the P' chart of Laney with a column switcher:
Graph=Expr(Control Chart(
Sample Label( :Numéro de lot ),
Sample Size( :Nombre de seringues ),
KSigma(TBD),
Sort by Row Order( 1 ),
Chart Col( :"Y1", P( Test Beyond Limits( 1 ), Limits Precision( 1 ), LCL( -3 ) ) ),
SendToReport(
Dispatch(
{},
"P of Y1",
OutlineBox,
{Set Title( "p'-chart, p of Y1" )}
),
Dispatch(
{"P of Y1"},
"2",
ScaleBox,
{Format( "Fixed Dec", 12, 5 ), Min( -0.00025 ), Max( 0.0025 ),
Inc( 0.00025 ), Minor Ticks( 1 )}
),
Dispatch(
{"P of Y1"},
"1",
ScaleBox,
{Min( 0.5 ), Inc( 1 ), Minor Ticks( 0 )}
),
Dispatch(
{"P of Y1"},
"",
AxisBox,
{Add Axis Label( "Taux de défauts pour Y1" )}
),
Dispatch(
{"P of Y1"},
"Proportion",
TextEditBox,
{Set Text( "Taux de défauts pour Y1" )}
),
);
);
);
SubstituteInto(graph, Expr(TBD), z_KSigmaZ);
ColumnSwitcherObject = graph << Column Switcher( :Y1,{:Y1, :Y2});
However, I don't know how to calculate the right z_KSigmaZ
coefficient based on the column selected with the column switcher.
Do you have an idea to help me with this?
Thank's a lot for your answer,
Sebastien