<?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 How to write a script for Wilcoxon rank-sum test for thousands features in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82703#M37255</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="demo.PNG" style="width: 0px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14250i314371885E9BD488/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="demo.PNG" alt="demo.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="demo.PNG" style="width: 646px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14251i68EA4FE6CE0047B8/image-dimensions/646x269?v=v2" width="646" height="269" role="button" title="demo.PNG" alt="demo.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi all experts,&amp;nbsp; I am an user of JMP. I am writing to learn how to write a script to&amp;nbsp;caculate Wilcoxon rank-sum test results for thousands of features. The tables of grouping and features(from feature_1 to feature_n) are attached as the figure above. Here is what I am going to do:&lt;/P&gt;&lt;P&gt;1) Wilcoson rank-sum test for "&lt;EM&gt;Treatment A vs. No treatment"&lt;/EM&gt; for feature_1 to feature_2000. I understand I need to use "fit Y by X" funtion. The X should be the grouping (Treatment); and the Y should be the value corresponding to feature_1, 2....n.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I understand how to it mannully. The code for each feature is kinda like this:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff00ff"&gt;&amp;nbsp;&amp;nbsp;Fit Group(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff00ff"&gt;&amp;nbsp;Oneway( Y( :Feature_1 ), X( :Treatment ), Wilcoxon Test( 1 ) ),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;However, I don't know how to write a script to let it pick up the column items only have "No treatment" and "Treatment A"; and how to make it run as a loop to finish feature 1 and then feature 2 and till feature 2000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I have tried my best to read the scripting guid. However, I can only catch the basic concept and don't really can make it solved. I will be really grateful if anyone here can at least give a hand here.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you so much..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Best,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Windermere&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Nov 2018 21:49:47 GMT</pubDate>
    <dc:creator>Windermere</dc:creator>
    <dc:date>2018-11-06T21:49:47Z</dc:date>
    <item>
      <title>How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82703#M37255</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="demo.PNG" style="width: 0px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14250i314371885E9BD488/image-size/small?v=v2&amp;amp;px=200" width="0" height="0" role="button" title="demo.PNG" alt="demo.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="demo.PNG" style="width: 646px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/14251i68EA4FE6CE0047B8/image-dimensions/646x269?v=v2" width="646" height="269" role="button" title="demo.PNG" alt="demo.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hi all experts,&amp;nbsp; I am an user of JMP. I am writing to learn how to write a script to&amp;nbsp;caculate Wilcoxon rank-sum test results for thousands of features. The tables of grouping and features(from feature_1 to feature_n) are attached as the figure above. Here is what I am going to do:&lt;/P&gt;&lt;P&gt;1) Wilcoson rank-sum test for "&lt;EM&gt;Treatment A vs. No treatment"&lt;/EM&gt; for feature_1 to feature_2000. I understand I need to use "fit Y by X" funtion. The X should be the grouping (Treatment); and the Y should be the value corresponding to feature_1, 2....n.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I understand how to it mannully. The code for each feature is kinda like this:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff00ff"&gt;&amp;nbsp;&amp;nbsp;Fit Group(&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#ff00ff"&gt;&amp;nbsp;Oneway( Y( :Feature_1 ), X( :Treatment ), Wilcoxon Test( 1 ) ),&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;However, I don't know how to write a script to let it pick up the column items only have "No treatment" and "Treatment A"; and how to make it run as a loop to finish feature 1 and then feature 2 and till feature 2000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;I have tried my best to read the scripting guid. However, I can only catch the basic concept and don't really can make it solved. I will be really grateful if anyone here can at least give a hand here.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thank you so much..&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Best,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Windermere&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 21:49:47 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82703#M37255</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-06T21:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82706#M37258</link>
      <description>&lt;P&gt;The two solutions that I can quickly see are either setting the Row State for all of the rows that do not have "No Treatment" or "Treatment A" to "Hide and Exclude", and then running your Fit Y by X analyses&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=current data table();

dt &amp;lt;&amp;lt; select where(:treatment !="No Treatment" &amp;amp; :treatment !="Treatment A");
&lt;BR /&gt;dt &amp;lt;&amp;lt; Hide and Exclude;

dt &amp;lt;&amp;lt; Fit Group(
     Oneway(………………………..));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or, subset the data into a new table that only has the "No Treatment" and "Treatment A" rows, and then do the analysis&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);
dt=current data table();

dt &amp;lt;&amp;lt; select where(:treatment =="No Treatment" | :treatment !=="Treatment A");

dt2=dt&amp;lt;&amp;lt;subset(selected columns(0), selected rows(1));

dt2 &amp;lt;&amp;lt; Fit Group(
     Oneway(………………………..));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 22:09:43 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82706#M37258</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-11-06T22:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82708#M37260</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thank you for your solution for picking the group information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how to do the test for feature_1, to feauture_2000 as a loop? Could you please also provide a solution for that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windermere&lt;/P&gt;</description>
      <pubDate>Tue, 06 Nov 2018 22:20:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82708#M37260</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-06T22:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82711#M37262</link>
      <description>&lt;P&gt;Looping across columns and running one of the platforms, is one of the most common items handled in the Discussion Forum.&amp;nbsp; Searching on "Looping" brings up multiple selections.&amp;nbsp; Below is an example of looping taken from an example of looping across columns and running a Graph Builder Platform.&amp;nbsp; The looping for a Oneway Platform will be very similar.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\Fitness.jmp" );

/* Obtain a list of numeric/continuous column names as strings */
colList = dt &amp;lt;&amp;lt; Get Column Names( Continuous, String );

/* Loop through the list to generate the desired Graph Builder 
   and save the report as a JPEG file */
For( i = 2, i &amp;lt;= Nitems( colList ), i++,
	gb = dt &amp;lt;&amp;lt; Graph Builder(
		Size( 534, 454 ),
		Show Control Panel( 0 ),
		Variables(
			X( :Age ),
			Y( Column( dt, colList[i] ) ),
			Color( :Age )
		),
		Elements(
			Points(
				X,
				Y,
				Legend( 3 ),
				Summary Statistic( "Mean" ),
				Error Bars( "Confidence Interval" )
			)
		),
		SendToReport(
			Dispatch(
				{},
				"Graph Builder",
				FrameBox,
				{Marker Size( 5 )}
			)
		), 
		Invisible
	);
	gb &amp;lt;&amp;lt; Save Picture( "E:\Trash\Graph Builder_" || colList[i] ||".jpg", JPEG );
);

/* Close table and all invisible reports */
Close( dt, No Save );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 22:45:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82711#M37262</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-11-06T22:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82729#M37270</link>
      <description>&lt;P&gt;Hi txnelson,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thank you for your help. Just want to make sure I understand the following things in a correct way.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;1.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token comment"&gt;/* Obtain a list of numeric/continuous column names as strings */&lt;/SPAN&gt;
colList &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; dt &lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token messages"&gt; Get Column Names&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; Continuous&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; String &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;For my table, I should write it as&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;colList &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; dt &lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="token messages"&gt; "Feature_1"&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; Continuous&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; String &lt;SPAN class="token punctuation"&gt;); &lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Is it correct?&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;2.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token function"&gt;For&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; i &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;2&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; i &lt;SPAN class="token operator"&gt;&amp;lt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Nitems&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; colList &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="token operator"&gt;++&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;In my case, it should be written as&lt;/P&gt;&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;&lt;SPAN class="token function"&gt;For&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; i &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token number"&gt;0&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; i &lt;SPAN class="token operator"&gt;&amp;lt;=&lt;/SPAN&gt; feature_2000&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt; colList &lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="token operator"&gt;++&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is that correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I don't really undertand what does i=0, i=1, i=2 mean? Could you please explain?&lt;/P&gt;&lt;P&gt;"Nitems" should be changed to the column name of the last column (feature_2000). Is my understanding correct?&lt;/P&gt;&lt;P&gt;Also, do we need a ")" to stop this loop? The template you shown below didnot have the ")".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try the script tomorrow and give you a feebback.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windermere&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2018 05:09:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82729#M37270</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-07T05:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82866#M37334</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Open a sample data table */
dt = Open( "$Sheet1.jmp" );
/* Obtain a list of numeric/continuous column names as strings */
colList = dt &amp;lt;&amp;lt; Feature_1( Continuous, String );
For( i = 2, i &amp;lt;= N Items( colList ), i++, );
Oneway(
	Y( :colList ),
	X( :Treatment ),
	Wilcoxon Test( 1 )
);
&amp;lt;&amp;lt;{Arrange in Rows( 1 )};&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the script I used.&lt;/P&gt;
&lt;P&gt;Unfortunately,&lt;/P&gt;
&lt;P&gt;It does not work at all..&lt;/P&gt;
&lt;P&gt;No reponse.&lt;/P&gt;
&lt;P&gt;Does anyone know why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 17:53:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82866#M37334</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T17:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82867#M37335</link>
      <description>&lt;P&gt;Below is an annotated script that should give you what you want.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\big class.jmp" );
/* Obtain a list of numeric/continuous column names */
colList = dt &amp;lt;&amp;lt; Get Column Names( Continuous );

// If you run a Oneway analysis, and specify to Arrange in Rows
// and then save the script, it generates
/*
Fit Group(
	Oneway( Y( :height ), X( :sex ) ),
	Oneway( Y( :weight ), X( :sex ) ),
	&amp;lt;&amp;lt;{Arrange in Rows( 200 )}
)
*/
// A little modification to include all of the columns that
// were extracted using the &amp;lt;&amp;lt; Get Columns Names message, and
// the script below will give you what you want
Fit Group(
	Oneway( Y( Eval( colList ) ), X( :sex ) ),
	// If you want all of the outputs in a single row and you don't 
	// know how many there will be, a simple way to handle this is
	// to just specify a large number
	&amp;lt;&amp;lt;{Arrange in Rows( 200 )}
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;All functions and messages in the script above are documented with examples in the Scripting Index&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Scripting Index&lt;/P&gt;
&lt;P&gt;The JSL structures and methods are documented in the Scripting Guide&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;
&lt;P&gt;However, it seems that you are currently limited in your programming knowledge and experience.&amp;nbsp; I strongly suggest that you pick up one of the many books on Introduction to programming.&amp;nbsp; While you will not find a book on "Introduction to Programming for JMP Scripting Language", what is really needed is to learn the concepts of programming.&amp;nbsp; Once that is understood, then switching between languages in the programming world becomes a simple matter of learning the new syntax of the new language.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 16:04:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82867#M37335</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-11-08T16:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82870#M37338</link>
      <description>&lt;P&gt;Thank you and you are absoultely right that I dont have scripitng writing training and experience.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will try again, also need to read. I hope you dont mind if I post anything here if I dont understand...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your patience.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windermere&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 16:51:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82870#M37338</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-08T16:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82936#M37366</link>
      <description>&lt;P&gt;Jim has already given you some great help and guidance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly, you may have upwards of 2,000 features, so it might be marginally more efficient to avoid looping over them. Also, looking at 2,000 reports is not great, so you probably need to summarise the results in some way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case you can indeed avoid the loop, so you might like to understand how the code below works to help you go further with JSL. Generally stacking the data and using a 'By' variable is a good coding pattern to be aware of. Of course in the example there's only two 'features' (heinght and weight).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;// Open a sample data table
dt = Open( "$SAMPLE_DATA\big class.jmp" );

// Obtain a list of column names containing the 'features'
colList = dt &amp;lt;&amp;lt; Get Column Names( Continuous );

// Stack the data
dt2 = dt &amp;lt;&amp;lt; Stack(
	columns( colList ),
	Source Label Column( "Feature" ),
	Stacked Data Column( "Data" ),
	Output Table( (dt &amp;lt;&amp;lt; getName)||" Stacked" )
);
Close(dt, NoSave);

// Do the Wilcoxon tests all at the same time (this will be a list, due to the use of the 'By' variable)
ow = dt2 &amp;lt;&amp;lt; Oneway( Y( :Data ), X( :sex ), Wilcoxon Test( 1 ), By(:Feature) );

// Get a link to the first report
firstOwRep = Report(ow[1]); 

// Get the one way ChiSq results from ALL reports (features) into a single table
dt3 = firstOwRep[TableBox(3)] &amp;lt;&amp;lt; makeCombinedDataTable;
dt3 &amp;lt;&amp;lt; setName("One Way ChiSquare Results By Feature");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, when applying a statistical test thousands of times, you need to consider that the false alarm rate will inevitably be high.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 09:50:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82936#M37366</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-11-09T09:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82943#M37370</link>
      <description>&lt;P&gt;Another option to consider is the JMP response screenning function. &amp;nbsp;It doesn't do the rank-sum test, rather a t-test or a robust test (to downweight outliers). It runs fast, provides a table of p-values, graphs for significance vs. effect sizes, and best of all has a "fit selected" option so you can easily fit Y by X of those features of most interest to you and then you could run the Wilcoxon&amp;nbsp;test on a subset of the 2000 features.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/14/response-screening.shtml" target="_blank"&gt;https://www.jmp.com/support/help/14/response-screening.shtml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 13:16:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/82943#M37370</guid>
      <dc:creator>KarenC</dc:creator>
      <dc:date>2018-11-09T13:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83291#M37476</link>
      <description>&lt;P&gt;I am sorry. It still does not work.&lt;/P&gt;&lt;P&gt;I am wondering any one can help with the specific case. I am sorry that I dont know how to write the loop start from the column named Feature_1 to the end. I really hope that who can explain how to write the script on that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 16:28:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83291#M37476</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T16:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83292#M37477</link>
      <description>&lt;P&gt;Here is an example of doing what you want.&amp;nbsp; I am using a sample data table that has a lot of continuous variables.&amp;nbsp; I change the name of one of the continuous columns to "Feature_1" to mimic the name of the column you are targeting on.&amp;nbsp; I then delete all continuous columns from the colList that appear before the "Feature_1" column and then run the analysis on all fo the remaining columns.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

/* Open a sample data table */
dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );

// For illustration, change the name of one of the columns to "Feature_1"
Column( dt, 10 ) &amp;lt;&amp;lt; set name( "Feature_1" );

/* Obtain a list of numeric/continuous column names */
colList = dt &amp;lt;&amp;lt; Get Column Names( Continuous );

// Remove from the list of columns, all columns before the column called
// "Feature_1"
If( Contains( colList, Parse( "Feature_1" ) ) &amp;gt; 1,
	colList = Remove( colList, 1, Contains( colList, Parse( "Feature_1" ) ) - 1 )
);

// Run the analysis
Fit Group(
	Oneway( Y( Eval( colList ) ), X( :Wafer ), Wilcoxon Test( 1 ) ), 
	// If you want all of the outputs in a single row and you don't 
	// know how many there will be, a simple way to handle this is
	// to just specify a large number
	&amp;lt;&amp;lt;{Arrange in Rows( 200 )}
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please take the time to read through the Scripting Guide to learn what scripting is all about&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; Help==&amp;gt;Books==&amp;gt;Scripting Guide&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 16:53:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83292#M37477</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-11-14T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83295#M37479</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "$C:\Users\yuanyli4\Desktop\JMP TEST\Sheet1.jmp" );
colList = dt &amp;lt;&amp;lt; Get Column Names( Continuous );
dt2 = dt &amp;lt;&amp;lt; Stack(
	columns( colList ),
	source Label Column( "Feature" ),
	Stacked Data Column( "Data" ),
	Output Table( (dt &amp;lt;&amp;lt; getName) || "Stacked" )
);
Close( dt, NoSave );
ow = dt2 &amp;lt;&amp;lt; Oneway(
	Y( :Data ),
	X( :Treatment ),
	wilcoxon Test( 1 ),
	By( :Feature )
);
firstOwRep = Report( ow[1] );
dt3 = firstOwRep[Table Box( 3 )] &amp;lt;&amp;lt; makeCombinedDataTable;
dt3 &amp;lt;&amp;lt; setName( "One Way Chisquare Results By Feature" );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the things I wrote on the basis of the most updated suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is still not working... :(&lt;/img&gt;&lt;/P&gt;
&lt;P&gt;When I try to run it. No response at all...&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 17:55:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83295#M37479</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T17:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83301#M37480</link>
      <description>&lt;P&gt;Hi Jim,If I try to open a dataset which is not in SAMPLE_DATA but somewhere under the windows, for example, like this&amp;nbsp;"C:\Users\yuanyli4\Desktop\JMP TEST\Sheet1.jmp"&lt;/P&gt;&lt;P&gt;Should I write it like this?&lt;/P&gt;&lt;P&gt;dt= Open("$C:\Users\yuanyli4\Desktop\JMP TEST\Sheet1.jmp");&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 17:50:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83301#M37480</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T17:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83305#M37481</link>
      <description>Think you just need “C” (not “$C”) at the start of the filename of the file you are trying to open.&lt;BR /&gt;</description>
      <pubDate>Wed, 14 Nov 2018 17:55:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83305#M37481</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2018-11-14T17:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83307#M37483</link>
      <description>&lt;P&gt;Finally, It works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That is a good experience of learning.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Windermere&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 18:05:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83307#M37483</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T18:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a script for Wilcoxon rank-sum test for thousands features</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83308#M37484</link>
      <description>&lt;P&gt;Yep...you are right. I should not use the $.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I believe both yours and Jim's solutions work now&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 18:06:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-write-a-script-for-Wilcoxon-rank-sum-test-for-thousands/m-p/83308#M37484</guid>
      <dc:creator>Windermere</dc:creator>
      <dc:date>2018-11-14T18:06:56Z</dc:date>
    </item>
  </channel>
</rss>

