<?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 save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/235895#M46527</link>
    <description>&lt;P&gt;Phantastic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here some pointers for interested users:&lt;/P&gt;&lt;P&gt;JMP calculates correlations for retained fields only. Consequences of accidentally kept character columns:&lt;BR /&gt;(1) different structures: Spearman matrix keeps character columns; Pearson matrix filters them out automatically&lt;BR /&gt;(2) Missing values: Spearman does not calculate coefficients but places missing values&lt;/P&gt;&lt;P&gt;(3) Column order: Pearson: as in original dataset, Spearman: alphabetical.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Nov 2019 09:43:10 GMT</pubDate>
    <dc:creator>Newbie2Jumpie</dc:creator>
    <dc:date>2019-11-21T09:43:10Z</dc:date>
    <item>
      <title>How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233493#M46284</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I've writen a small program that computes and saves Pearson coefficients directly into a JMP table.&lt;BR /&gt;Can you help adapt it to save Spearman coefficients in the same way? The "Spearman" option has no effect on storing ... one of th emany options I tried so far...&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;PRE&gt;dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt_2 = dt &amp;lt;&amp;lt; Multivariate(
Y(
:Name( "Mass" ),
:Name( "Fore" ),
:Name( "Bicep" ),
:Name( "Chest" )
),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 ),
Spearman's ρ(1)

);


dt_2= report(dt_2)
[Outline Box("Correlations")][1, 1] &amp;lt;&amp;lt; make into data table;

dt_2 &amp;lt;&amp;lt; save("C:\....\Spearman.jmp") ;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 08:28:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233493#M46284</guid>
      <dc:creator>Newbie2Jumpie</dc:creator>
      <dc:date>2019-11-13T08:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233515#M46286</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this do it?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt_2 = dt &amp;lt;&amp;lt; Multivariate(
Y(
:Name( "Mass" ),
:Name( "Fore" ),
:Name( "Bicep" ),
:Name( "Chest" )
),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 ),
Spearman's ρ(1)

);

report(dt_2)
[Outline Box("Correlations")][1, 1] &amp;lt;&amp;lt; make into data table;

Report( dt_2 )
[Outline Box( "Nonparametric: Spearman's ρ" )][Table Box( 1 )] &amp;lt;&amp;lt;
Make Into Data Table;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 08:47:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233515#M46286</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2019-11-13T08:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233543#M46293</link>
      <description>&lt;P&gt;We'r getting close. I'm glad I learned about the "Outline Box" options.&lt;/P&gt;&lt;P&gt;Unfortunately, the output matrix shape is "triangular", not "square" (as needed; the "diagonal" 1.0s are missing because of this, too).&lt;/P&gt;&lt;P&gt;Is it easy to get there?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 10:29:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233543#M46293</guid>
      <dc:creator>Newbie2Jumpie</dc:creator>
      <dc:date>2019-11-13T10:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233544#M46294</link>
      <description>&lt;P&gt;Hi agian,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It took a little manipulating, but see if you can make this work for you:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt_2 = dt &amp;lt;&amp;lt; Multivariate(
Y(
:Name( "Mass" ),
:Name( "Fore" ),
:Name( "Bicep" ),
:Name( "Chest" )
),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 ),
Spearman's ρ(1)

);

report(dt_2)
[Outline Box("Correlations")][1, 1] &amp;lt;&amp;lt; make into data table;

dt_spearman=Report( dt_2 )
[Outline Box( "Nonparametric: Spearman's ρ" )][Table Box( 1 )] &amp;lt;&amp;lt;
Make Into Data Table;

variables={"Mass","Fore","Bicep","Chest"};
For(i=1,i&amp;lt;=4,i++,
dt_spearman&amp;lt;&amp;lt;add rows(1);
Column(dt_spearman,1)[Nrows(dt_spearman)]=variables[i];
Column(dt_spearman,2)[Nrows(dt_spearman)]=variables[i];
Column(dt_spearman,3)[Nrows(dt_spearman)]=1;
);

Column(dt_spearman,1)&amp;lt;&amp;lt;Set Property("Value Ordering",{"Mass","Fore","Bicep","Chest"});
Column(dt_spearman,2)&amp;lt;&amp;lt;Set Property("Value Ordering",{"Mass","Fore","Bicep","Chest"});

dt_split= dt_spearman &amp;lt;&amp;lt; Split(
	Split By( :Variable ),
	Split( :Spearman ρ ),
	Group( :by Variable ),
	Remaining Columns( Drop All ),
	Sort by Column Property
);

For(i=2,i&amp;lt;=Nrows(dt_split),i++,
	For(j=1,j&amp;lt;=Nrows(dt_split)-1,j++,
	
	Column(dt_split,i)[j+1]=Column(dt_split,j+2)[i-1];
		
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 11:39:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233544#M46294</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2019-11-13T11:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233555#M46296</link>
      <description>&lt;P&gt;Anytically speaking: Yes, it's the square matrix.You've done an impressive job, seriously.&lt;/P&gt;&lt;P&gt;From a technial point of views: This cannot work for me: I need these Spearman matrices for several datasets with 100s of fields.&lt;/P&gt;&lt;P&gt;I simply cannot change manually from triangular to square every time.&amp;nbsp;I need to think of something else.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/7531"&gt;@HadleyMyers&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Hi agian,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It took a little manipulating, but see if you can make this work for you:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

dt_2 = dt &amp;lt;&amp;lt; Multivariate(
Y(
:Name( "Mass" ),
:Name( "Fore" ),
:Name( "Bicep" ),
:Name( "Chest" )
),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 ),
Spearman's ρ(1)

);

report(dt_2)
[Outline Box("Correlations")][1, 1] &amp;lt;&amp;lt; make into data table;

dt_spearman=Report( dt_2 )
[Outline Box( "Nonparametric: Spearman's ρ" )][Table Box( 1 )] &amp;lt;&amp;lt;
Make Into Data Table;

variables={"Mass","Fore","Bicep","Chest"};
For(i=1,i&amp;lt;=4,i++,
dt_spearman&amp;lt;&amp;lt;add rows(1);
Column(dt_spearman,1)[Nrows(dt_spearman)]=variables[i];
Column(dt_spearman,2)[Nrows(dt_spearman)]=variables[i];
Column(dt_spearman,3)[Nrows(dt_spearman)]=1;
);

Column(dt_spearman,1)&amp;lt;&amp;lt;Set Property("Value Ordering",{"Mass","Fore","Bicep","Chest"});
Column(dt_spearman,2)&amp;lt;&amp;lt;Set Property("Value Ordering",{"Mass","Fore","Bicep","Chest"});

dt_split= dt_spearman &amp;lt;&amp;lt; Split(
	Split By( :Variable ),
	Split( :Spearman ρ ),
	Group( :by Variable ),
	Remaining Columns( Drop All ),
	Sort by Column Property
);

For(i=2,i&amp;lt;=Nrows(dt_split),i++,
	For(j=1,j&amp;lt;=Nrows(dt_split)-1,j++,
	
	Column(dt_split,i)[j+1]=Column(dt_split,j+2)[i-1];
		
	)
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 11:59:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233555#M46296</guid>
      <dc:creator>Newbie2Jumpie</dc:creator>
      <dc:date>2019-11-13T11:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233557#M46298</link>
      <description>&lt;P&gt;Would it be possible to generalize my script, or parts of it, so it can be used with your datasets?&amp;nbsp; If you can post one of your datasets after anonymizing the data (Table--&amp;gt;Anonymize), and create the multivariate script, maybe we can work something out?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 12:17:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233557#M46298</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2019-11-13T12:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233558#M46299</link>
      <description>&lt;PRE class=" language-jsl"&gt;&lt;CODE class="  language-jsl"&gt;dt &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Open&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;"$SAMPLE_DATA/Body Measurements.jmp"&lt;/SPAN&gt;&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;I have a better idea. Can you maybe generalize your approach to all columns in the "Body measurements" dataset (see link above)?&lt;/P&gt;&lt;P&gt;If we want to be bold, we could pretend the first column is an ID we want to skip... That would be the icing on the cake...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2019 12:43:55 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233558#M46299</guid>
      <dc:creator>Newbie2Jumpie</dc:creator>
      <dc:date>2019-11-13T12:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233563#M46302</link>
      <description>&lt;P&gt;I think this should do it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open("$SAMPLE_DATA/Body Measurements.jmp");

colnameslist=dt&amp;lt;&amp;lt;Get Column Names(string);

Remove From(colnameslist,1);


dt_2 = dt &amp;lt;&amp;lt; Multivariate(
Y(
Eval(colnameslist)
),
Estimation Method( "Row-wise" ),
Matrix Format( "Square" ),
Scatterplot Matrix( 0 ),
Spearman's ρ(1)

);

report(dt_2)
[Outline Box("Correlations")][1, 1] &amp;lt;&amp;lt; make into data table;

dt_spearman=Report( dt_2 )
[Outline Box( "Nonparametric: Spearman's ρ" )][Table Box( 1 )] &amp;lt;&amp;lt;
Make Into Data Table;


For(i=1,i&amp;lt;=Nitems(colnameslist),i++,
dt_spearman&amp;lt;&amp;lt;add rows(1);
Column(dt_spearman,1)[Nrows(dt_spearman)]=colnameslist[i];
Column(dt_spearman,2)[Nrows(dt_spearman)]=colnameslist[i];
Column(dt_spearman,3)[Nrows(dt_spearman)]=1;
);



dt_split= dt_spearman &amp;lt;&amp;lt; Split(
	Split By( :Variable ),
	Split( :Spearman ρ ),
	Group( :by Variable ),
	Remaining Columns( Drop All ),
	Sort by Column Property
);

For(i=2,i&amp;lt;=Nrows(dt_split),i++,
	For(j=1,j&amp;lt;=Nrows(dt_split)-1,j++,
	
	if(is Missing(Column(dt_split,i)[j+1]),
	
	Column(dt_split,i)[j+1]=Column(dt_split,j+2)[i-1];,
	
	Column(dt_split,j+2)[i-1]=Column(dt_split,i)[j+1];
	)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Nov 2019 13:11:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/233563#M46302</guid>
      <dc:creator>HadleyMyers</dc:creator>
      <dc:date>2019-11-13T13:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to save Spearman Correlation Coefficients directly into JMP data table (scripting, JSL)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/235895#M46527</link>
      <description>&lt;P&gt;Phantastic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here some pointers for interested users:&lt;/P&gt;&lt;P&gt;JMP calculates correlations for retained fields only. Consequences of accidentally kept character columns:&lt;BR /&gt;(1) different structures: Spearman matrix keeps character columns; Pearson matrix filters them out automatically&lt;BR /&gt;(2) Missing values: Spearman does not calculate coefficients but places missing values&lt;/P&gt;&lt;P&gt;(3) Column order: Pearson: as in original dataset, Spearman: alphabetical.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 09:43:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-save-Spearman-Correlation-Coefficients-directly-into-JMP/m-p/235895#M46527</guid>
      <dc:creator>Newbie2Jumpie</dc:creator>
      <dc:date>2019-11-21T09:43:10Z</dc:date>
    </item>
  </channel>
</rss>

