<?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 transform matrix into 2D data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/373687#M62340</link>
    <description>&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/summarize-your-data.shtml#" target="_self"&gt;Tables-&amp;gt;Summary&lt;/A&gt; is the way to create data tables that aggregate and summarize data. The &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/create-a-table-of-summary-statistics.shtml" target="_self"&gt;Summary() message&lt;/A&gt; is the JSL way to create the data table.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-04-01_16-24-29.765.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31832iDA09597BE690D05D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2021-04-01_16-24-29.765.png" alt="2021-04-01_16-24-29.765.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Big Class" ) &amp;lt;&amp;lt; Summary(
	Group( :age, :sex ),
	N,
	Freq( "None" ),
	Weight( "None" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In contrast, the &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/store-summary-statistics-in-global-variables.shtml#ww727156" target="_self"&gt;Summarize() function&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;collects summary statistics for a data table and stores them in variables. This is useful if you need to use the summary statistics elsewhere in your script.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(g=by(age, sex), c=count());
show(g, c);
output:
g:{{"12", "12", "13", "13", "14", "14", "15", "15", "16", "16", "17",
"17"}, {"F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M"}}
c:[5,3,3,4,5,7,2,5,2,1,1,2]&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Apr 2021 20:33:41 GMT</pubDate>
    <dc:creator>Jeff_Perkinson</dc:creator>
    <dc:date>2021-04-01T20:33:41Z</dc:date>
    <item>
      <title>How to transform matrix into 2D data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1768#M1768</link>
      <description>&lt;P&gt;Input:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(g=by(age, sex), c=count());
show(g, c);
output:
g:{{"12", "12", "13", "13", "14", "14", "15", "15", "16", "16", "17",
"17"}, {"F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M"}}
c:[5,3,3,4,5,7,2,5,2,1,1,2]&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How to make the result into a data table with column as sex and row as age? Like pivot table?&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:13:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1768#M1768</guid>
      <dc:creator />
      <dc:date>2023-06-10T23:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform matrix into 2D data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1769#M1769</link>
      <description>&lt;P&gt;You can use e.g. for-loops to populate a data table with those results.&lt;BR /&gt;&lt;BR /&gt;However, a more direct way to obtain a pivot table is to use the summary command using subgroups. &lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Big Class" ) &amp;lt;&amp;lt; Summary( Group( :age ), N, Subgroup( :sex ) );
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 20:19:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1769#M1769</guid>
      <dc:creator>ms</dc:creator>
      <dc:date>2021-04-01T20:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform matrix into 2D data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1770#M1770</link>
      <description>Please, are you perhaps looking for something as simple as a summary table of counts by age(rows) and sex(cols)?  Example below.  If more complicated please expand.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;-Matt</description>
      <pubDate>Wed, 05 May 2010 12:56:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1770#M1770</guid>
      <dc:creator>mattf</dc:creator>
      <dc:date>2010-05-05T12:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform matrix into 2D data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1771#M1771</link>
      <description>thanks.  both are working. However, I need to have some other columns calulated based on the summary table and then put it into report. I think summary() might be more flexible.</description>
      <pubDate>Wed, 05 May 2010 22:28:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/1771#M1771</guid>
      <dc:creator />
      <dc:date>2010-05-05T22:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform matrix into 2D data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/373687#M62340</link>
      <description>&lt;P&gt;&lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/summarize-your-data.shtml#" target="_self"&gt;Tables-&amp;gt;Summary&lt;/A&gt; is the way to create data tables that aggregate and summarize data. The &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/create-a-table-of-summary-statistics.shtml" target="_self"&gt;Summary() message&lt;/A&gt; is the JSL way to create the data table.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-04-01_16-24-29.765.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/31832iDA09597BE690D05D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="2021-04-01_16-24-29.765.png" alt="2021-04-01_16-24-29.765.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Data Table( "Big Class" ) &amp;lt;&amp;lt; Summary(
	Group( :age, :sex ),
	N,
	Freq( "None" ),
	Weight( "None" )
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In contrast, the &lt;A href="https://www.jmp.com/support/help/en/16.0/#page/jmp/store-summary-statistics-in-global-variables.shtml#ww727156" target="_self"&gt;Summarize() function&lt;/A&gt;&amp;nbsp;&lt;SPAN&gt;collects summary statistics for a data table and stores them in variables. This is useful if you need to use the summary statistics elsewhere in your script.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(g=by(age, sex), c=count());
show(g, c);
output:
g:{{"12", "12", "13", "13", "14", "14", "15", "15", "16", "16", "17",
"17"}, {"F", "M", "F", "M", "F", "M", "F", "M", "F", "M", "F", "M"}}
c:[5,3,3,4,5,7,2,5,2,1,1,2]&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Apr 2021 20:33:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-transform-matrix-into-2D-data-table/m-p/373687#M62340</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2021-04-01T20:33:41Z</dc:date>
    </item>
  </channel>
</rss>

