<?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: How to find every test to screen a unit in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/453244#M70018</link>
    <description>&lt;P&gt;I would just create a subset of the original data table and run the analysis on it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
ECIDsToTest = { "413257", "56739",...........};

dt &amp;lt;&amp;lt; select where( contains( ECIDsToTest, :ECID ) );

dtToTest = dt &amp;lt;&amp;lt; subset( selected columns( 0 ), selected rows( 1 ) );

// Run the Z Score analysis on the new subset&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 22 Jan 2022 03:03:03 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2022-01-22T03:03:03Z</dc:date>
    <item>
      <title>How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/452596#M69926</link>
      <description>&lt;P&gt;I'm fairly new to JMP and JSL and currently working on screening out a unit in a very large dataset. My goal is to get an output table containing a name of every test in which the unit (defined by it's ECID) has a z-score greater than 3 (or some other value I can choose). These z-scores need to be based on each tests respective distributions of passing units. Is there JMP functionality for this or a script that has been made to do something along these lines. Below is my very loose pseudocode for a script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pseudocode:&lt;/P&gt;&lt;P&gt;Requires large enough dataset to have a normal distribution for different tests (minimum 30 good units)&lt;/P&gt;&lt;P&gt;Subset base data table into only bin 1 units&lt;/P&gt;&lt;P&gt;Calculate mean and std deviation for each test using only passing units&lt;/P&gt;&lt;P&gt;Calculate z-score in relation to each tests' mean and std deviation&lt;/P&gt;&lt;P&gt;Create output table with all tests and scores that are above 3&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:42:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/452596#M69926</guid>
      <dc:creator>MichaelO</dc:creator>
      <dc:date>2023-06-10T23:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/452651#M69934</link>
      <description>&lt;P&gt;Here is a sample script, that creates the Z scores and identifies the values that are greater than 3.&amp;nbsp; Is this in the direction of what you want?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Open Data Table: Probe.jmp
// → Data Table( "Probe" )
dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );

// Create a Bin column
dt &amp;lt;&amp;lt; New Column( "Bin",
	modeling type( nominal ),
	set each value( If( Random Uniform( 0, 1 ) &amp;lt;= .8, 1, Random Integer( 2, 7 ) ) )
);

// Get column names for all continuous columns
colNames = dt &amp;lt;&amp;lt; get column names( string, continuous );
For( i = 1, i &amp;lt;= N Items( colNames ), i++,
	mean = .;
	stddev = .;
// Create the Z scores for each test 
	dt &amp;lt;&amp;lt; New Column( colNames[i] || " Z Score",
		formula(
			If( Row() == 1,
				Mean = Col Mean( If( :Bin == 1, As Column( dt, colNames[i] ), . ) );
				Stddev = Col Std Dev( If( :Bin == 1, As Column( dt, colNames[i] ), . ) );
			);
			Abs( :Process 1 - Mean ) / Stddev;
		)
	);
	Column( dt, N Cols( dt ) ) &amp;lt;&amp;lt; delete formula;

	targetRows = dt &amp;lt;&amp;lt; get rows where( As Column( dt, N Cols( dt ) ) &amp;gt;= 3 );
	Try( As Column( dt, N Cols( dt ) ) &amp;lt;&amp;lt; color cells( "red", As List( targetRows ) ) );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jan 2022 04:43:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/452651#M69934</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-20T04:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/453181#M70009</link>
      <description>&lt;P&gt;This is a very good starting point. Thank you for your help. I would like to adopt this script so that I can run it only on units with a specific ECID within a large dataset. If I were to run this script on every datapoint/die I will unfortunately crash JMP. How would you recommend adopting this script to allow for this?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2022 22:33:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/453181#M70009</guid>
      <dc:creator>MichaelO</dc:creator>
      <dc:date>2022-01-21T22:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/453244#M70018</link>
      <description>&lt;P&gt;I would just create a subset of the original data table and run the analysis on it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = current data table();
ECIDsToTest = { "413257", "56739",...........};

dt &amp;lt;&amp;lt; select where( contains( ECIDsToTest, :ECID ) );

dtToTest = dt &amp;lt;&amp;lt; subset( selected columns( 0 ), selected rows( 1 ) );

// Run the Z Score analysis on the new subset&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 22 Jan 2022 03:03:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/453244#M70018</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-22T03:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454106#M70077</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't clear with my previous issue. I would like to find a single units z-score for every test based on the the entire dataset's distribution. Because of this, I can't just subset the ECID's of note. Secondly, I'm not sure the original script is working correctly. Upon further review, I've noticed that many of the z-scores are unlikely. There are some z-scores that are nearing triple digits.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelO_0-1643128128554.png" style="width: 953px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/39319iE062F138B9268EE7/image-dimensions/953x597?v=v2" width="953" height="597" role="button" title="MichaelO_0-1643128128554.png" alt="MichaelO_0-1643128128554.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 16:30:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454106#M70077</guid>
      <dc:creator>MichaelO</dc:creator>
      <dc:date>2022-01-25T16:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454285#M70087</link>
      <description>&lt;P&gt;Please provide a sample input data table, and a sample of what you are expecting for your output.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 20:38:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454285#M70087</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-25T20:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454366#M70090</link>
      <description>&lt;P&gt;I've modified and attached the Probe sample dataset to be my input data table. From there I would like to create a script that can output a table containing a list of tests (column names) found in the original dataset where the parametric data for an individual unit (denoted by it's ECID) has a Z-score above 3 (or some other user controlled value). I've attached a sample table output below. The attached output table is not based on the parametric data, but an example of what I would like. In this example, I am screening all tests in which the first unit in the Probe dataset (ECID:&amp;nbsp;Z1J4H_24_2_1) has parametric values that are greater than 3 sigma from the respective test's mean. Please let me know if I can clarify anything!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jan 2022 21:58:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454366#M70090</guid>
      <dc:creator>MichaelO</dc:creator>
      <dc:date>2022-01-25T21:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454398#M70093</link>
      <description>&lt;P&gt;Here is an example of one way of handling your issue.&amp;nbsp; The way I have set it up, is that you select the ECID rows in your input data table that you want to examine, and then run the script.&amp;nbsp; Check it out and see if it points you in a direction where you can make the finishing changes that you need.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Open Data Table: Probe.jmp
// → Data Table( "Probe" )
//dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
dt = Data Table( "Modified_Probe_Input" );

// Only run if at least one ECID row has been selected
If( N Rows( dt &amp;lt;&amp;lt; get selected rows() ) &amp;gt; 0, 

// Create a new data table to place the results in
	dtOutput = dt &amp;lt;&amp;lt; subset( selected rows( 1 ), selected columns( 0 ) );
	selRows = dt &amp;lt;&amp;lt; get selected rows;
	
// Get column names for all continuous columns
	colNames = dt &amp;lt;&amp;lt; get column names( string );
	Remove From( colNames, 1, 9 );	
	
	dtSum = dt &amp;lt;&amp;lt; Summary(
		invisible,
		Group( :Bin ),
		Mean( colNames ),
		Std Dev( colNames ),
		Freq( "None" ),
		Weight( "None" ),
		link to original data table(0)
	);
	dtSum &amp;lt;&amp;lt; select where( :Bin != 1 );
	Try( dtSum &amp;lt;&amp;lt; delete rows );
		
	For( i = 1, i &amp;lt;= N Items( colNames ), i++,
		Mean = Column( dtSum, "Mean(" || colNames[i] || ")" )[1];
		Stddev = Column( dtSum, "Std dev(" || colNames[i] || ")" )[1];
		column( dtOutput, colNames[i]) &amp;lt;&amp;lt; set name( column( dtOutput, colNames[i]) &amp;lt;&amp;lt; get name || " Z Score" );
		For( k = 1, k &amp;lt;= N Rows( dtOutput ), k++,
			Column( dtOutput, colNames[i] )[k] = Abs( As Column( dtOutput, colNames[i] )[k] - Mean ) / Stddev
		);


		targetRows = dtOutput &amp;lt;&amp;lt; get rows where( As Column( dtOutput, colNames[i] ) &amp;gt;= 3 );
		Try( As Column( dtOutput, colNames[i] ) &amp;lt;&amp;lt; color cells( "red", As List( targetRows ) ) );
	);
);
close( dtSum, nosave );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jan 2022 23:44:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/454398#M70093</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-01-25T23:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/456941#M70218</link>
      <description>&lt;P&gt;Hi Jim,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've looked at this script and it seems to work on the sample dataset I sent you. For whatever reason when I modify just a few lines to fit my need case I'm getting the following error: "Scoped data table access requires a data table column or variable{1}". I've changed the following lines to fit my needs: 6, 17, 21, and 28. Other than that, this is the same script that you've provided above. Any ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 21:56:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/456941#M70218</guid>
      <dc:creator>MichaelO</dc:creator>
      <dc:date>2022-01-28T21:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to find every test to screen a unit</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/457896#M70308</link>
      <description>&lt;P&gt;Can you supply a sample data table that is resulting in an error?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 21:35:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-find-every-test-to-screen-a-unit/m-p/457896#M70308</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-02-02T21:35:16Z</dc:date>
    </item>
  </channel>
</rss>

