<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help: JMP Script: Coefficient calculation based on a column switcher selection in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/476968#M72144</link>
    <description>&lt;P&gt;If I understand correctly, you will need 'Make Column Switch Handler()'. Do 'Help &amp;gt; Scripting Index', search for this, and take a look at the example.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Apr 2022 09:53:36 GMT</pubDate>
    <dc:creator>ian_jmp</dc:creator>
    <dc:date>2022-04-07T09:53:36Z</dc:date>
    <item>
      <title>Help: JMP Script: Coefficient calculation based on a column switcher selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/476932#M72140</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I need some help in order to adapt my P' chart of Laney for events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly, I need to determine a &lt;CODE class=" language-jsl"&gt;z_KSigmaZ &lt;/CODE&gt;coefficient based on the Y1 column with these lines:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;z_yyy = Eval( {: "Y1" } );
z_xx = z_yyy[1] &amp;lt;&amp;lt; get values;
z_nnn = Eval( {:Nombre de seringues} );
z_nn = z_nnn[1] &amp;lt;&amp;lt; 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;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then, I am creating the P' chart of Laney with a column switcher:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;	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 &amp;lt;&amp;lt; Column Switcher( :Y1,{:Y1, :Y2});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, I don't know how to calculate the right &lt;CODE class=" language-jsl"&gt;z_KSigmaZ&lt;/CODE&gt;&amp;nbsp;coefficient based on the column selected with the column switcher.&lt;/P&gt;&lt;P&gt;Do you have an idea to help me with this?&lt;/P&gt;&lt;P&gt;Thank's a lot for your answer,&lt;/P&gt;&lt;P&gt;Sebastien&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:56:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/476932#M72140</guid>
      <dc:creator>Sebastienlg</dc:creator>
      <dc:date>2023-06-09T16:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help: JMP Script: Coefficient calculation based on a column switcher selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/476968#M72144</link>
      <description>&lt;P&gt;If I understand correctly, you will need 'Make Column Switch Handler()'. Do 'Help &amp;gt; Scripting Index', search for this, and take a look at the example.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 09:53:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/476968#M72144</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2022-04-07T09:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help: JMP Script: Coefficient calculation based on a column switcher selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/477041#M72150</link>
      <description>&lt;P&gt;Yes it would be something like the '&lt;SPAN&gt;Make Column Switch Handler()'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However, I would like to apply it for the coefficient calculation and not a chart..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there a way to make it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Apr 2022 13:06:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/477041#M72150</guid>
      <dc:creator>Sebastienlg</dc:creator>
      <dc:date>2022-04-07T13:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: Help: JMP Script: Coefficient calculation based on a column switcher selection</title>
      <link>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/477814#M72237</link>
      <description>&lt;P&gt;I tried this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;		//Calcul du Zsigma
z_yyy = Eval( {:"Y1"n} );
z_xx = z_yyy[1] &amp;lt;&amp;lt; get values;
z_nnn = Eval( {:Nombre de seringues} );
z_nn = z_nnn[1] &amp;lt;&amp;lt; 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;
//&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And then, I wanted to create my column switcher on the z_yyy coefficient:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column = z_yyy &amp;lt;&amp;lt; Column Switcher( :"Y1"n,{:"Y1"n, :"Y2"n, :"Y3"n, :"Y4"n ,"Y5"n ,"Y6"n});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;However, I get a message error because the script is not applied on an object...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a solution for me?&lt;/P&gt;&lt;P&gt;I can't see how I can use the&amp;nbsp;&lt;SPAN&gt;Make Column Switch Handler....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sebastien&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 08:07:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Help-JMP-Script-Coefficient-calculation-based-on-a-column/m-p/477814#M72237</guid>
      <dc:creator>Sebastienlg</dc:creator>
      <dc:date>2022-04-11T08:07:37Z</dc:date>
    </item>
  </channel>
</rss>

