<?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 Bar graph of split column in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Bar-graph-of-split-column/m-p/283993#M54869</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a table with many columns. one is a binary variable with 0,1 and lables 0=No, 1=Yes.&lt;BR /&gt;Another is a formula column based on several others which is categorical with the numbers 0-5.&lt;BR /&gt;I would like to create a bar graph with the categorical column on the x axis and the percentage of yes in each category as the y axis.&lt;BR /&gt;I could obtain this data by splitting the table using these two columns (split by = the categorical column and split column= binary column) and then get the distribution of all columns (=original categories), and look at the prob of Yes.&lt;/P&gt;&lt;P&gt;but how do I get this in a bar graph?&lt;BR /&gt;this is a pic of the spited data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="morad2.JPG" style="width: 200px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25968iFE14368A4B695D21/image-size/small?v=v2&amp;amp;px=200" role="button" title="morad2.JPG" alt="morad2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this is a pic of the kind of graph i would like to create:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="morad1.JPG" style="width: 200px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25969iF0E04C5A688F4D11/image-size/small?v=v2&amp;amp;px=200" role="button" title="morad1.JPG" alt="morad1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
    <pubDate>Sun, 11 Jun 2023 11:04:15 GMT</pubDate>
    <dc:creator>eliyahu100</dc:creator>
    <dc:date>2023-06-11T11:04:15Z</dc:date>
    <item>
      <title>Bar graph of split column</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-graph-of-split-column/m-p/283993#M54869</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I have a table with many columns. one is a binary variable with 0,1 and lables 0=No, 1=Yes.&lt;BR /&gt;Another is a formula column based on several others which is categorical with the numbers 0-5.&lt;BR /&gt;I would like to create a bar graph with the categorical column on the x axis and the percentage of yes in each category as the y axis.&lt;BR /&gt;I could obtain this data by splitting the table using these two columns (split by = the categorical column and split column= binary column) and then get the distribution of all columns (=original categories), and look at the prob of Yes.&lt;/P&gt;&lt;P&gt;but how do I get this in a bar graph?&lt;BR /&gt;this is a pic of the spited data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="morad2.JPG" style="width: 200px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25968iFE14368A4B695D21/image-size/small?v=v2&amp;amp;px=200" role="button" title="morad2.JPG" alt="morad2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and this is a pic of the kind of graph i would like to create:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="morad1.JPG" style="width: 200px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25969iF0E04C5A688F4D11/image-size/small?v=v2&amp;amp;px=200" role="button" title="morad1.JPG" alt="morad1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;TIA&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:04:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-graph-of-split-column/m-p/283993#M54869</guid>
      <dc:creator>eliyahu100</dc:creator>
      <dc:date>2023-06-11T11:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bar graph of split column</title>
      <link>https://community.jmp.com/t5/Discussions/Bar-graph-of-split-column/m-p/284015#M54871</link>
      <description>&lt;P&gt;This can be accomplished fairly simply using&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Analyze==&amp;gt;Tabulate&lt;/P&gt;
&lt;P&gt;and then graphing the data from the resulting table&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab.PNG" style="width: 489px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25972iB16439C064285288/image-dimensions/489x366?v=v2" width="489" height="366" role="button" title="tab.PNG" alt="tab.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start with your 2 columns, the one with 0-1 values and the other with your 0-4 values. Both columns need to have a modeling type of Ordinal.&amp;nbsp; I have called the rows, "Intervention" and "Number of Positive Risk Factors".&amp;nbsp;
&lt;OL&gt;
&lt;LI&gt;Place "intervention as a column grouping variable&lt;/LI&gt;
&lt;LI&gt;Place "Number of Positive Risk Factors" as a row grouping variable&lt;/LI&gt;
&lt;LI&gt;Set the statistic as Row %&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab2.PNG" style="width: 616px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25974iC077AD1FAB520BEE/image-dimensions/616x506?v=v2" width="616" height="506" role="button" title="tab2.PNG" alt="tab2.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;Go to the red triangle and select "Make into Data Table"&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab3.PNG" style="width: 646px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25976i392A0AD2580BCFDE/image-dimensions/646x307?v=v2" width="646" height="307" role="button" title="tab3.PNG" alt="tab3.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Change the name of the Column "Row %(1)" to "Rate of Intervention"&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tab4.PNG" style="width: 575px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/25977i257E142C3791A070/image-size/large?v=v2&amp;amp;px=999" role="button" title="tab4.PNG" alt="tab4.PNG" /&gt;&lt;/span&gt;&lt;/LI&gt;
&lt;LI&gt;Go to Graph Builder and create the graph
&lt;OL&gt;
&lt;LI&gt;Drag "Number of Positive Risk Factors" to the X axis&lt;/LI&gt;
&lt;LI&gt;Drag "Rate of Intervention" to the Y axis&lt;/LI&gt;
&lt;LI&gt;Click on the Bar Graph icon to change the graph to a bar chart&lt;/LI&gt;
&lt;LI&gt;In the Bar details section on the left side of the window, change the Label to "Label by Value"&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Here is a script that produces the above&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);
dt=new table("Example",
	add rows(400),
	new column("Intervention", ordinal, set each value(Random Integer(0,1))),
	new column("Number of Positive Risk Factors",ordinal,set each value(Random Integer(0,4)))
);

// Calculate the Statistic
tab = dt &amp;lt;&amp;lt; Tabulate(invisible,
	Add Table(
		Column Table( Grouping Columns( :Intervention ), Statistics( Row % ) ),
		Row Table( Grouping Columns( :Number of Positive Risk Factors) )
	)
);
dtFinal = tab &amp;lt;&amp;lt; make into data table;

// Change Column Name
dtFinal:Name("Row %(1)") &amp;lt;&amp;lt; Set Name("Rate of Intervention");

// Create Graph
Graph Builder(
	Size( 534, 450 ),
	Show Control Panel( 0 ),
	Variables( X( :Number of Positive Risk Factors ), Y( :Rate of Intervention ) ),
	Elements( Bar( X, Y, Legend( 6 ), Label( "Label by Value" ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 04 Aug 2020 10:42:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Bar-graph-of-split-column/m-p/284015#M54871</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-08-04T10:42:25Z</dc:date>
    </item>
  </channel>
</rss>

