<?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: Scatterplot Help! in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698557#M9482</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356105"&gt;@Aerianna9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This was helpful for the grid. Now I'm needing help with the point count for each grid cell. Any ideas?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One way is to create a custom format for each range of value with the desired boundaries for cells. Then apply that format in procedure to count things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example using &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s example data set modified to create "nicer" cell boundaries:&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;call streaminit(123);&lt;BR /&gt;do i=1 to 100;&lt;BR /&gt;x=rand('uniform')*7;&lt;BR /&gt;y=rand('uniform')*7;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;proc format;
value xcell
0 -&amp;lt;1 = '1'
1 -&amp;lt;2 = '2'
2 -&amp;lt;3 = '3'
3 -&amp;lt;4 = '4'
4 -&amp;lt;5 = '5'
5 -&amp;lt;6 = '6'
6 -&amp;lt;7 = '7'
;
value ycell
0 -&amp;lt;1 = '1'
1 -&amp;lt;2 = '2'
2 -&amp;lt;3 = '3'
3 -&amp;lt;4 = '4'
4 -&amp;lt;5 = '5'
5 -&amp;lt;6 = '6'
6 -&amp;lt;7 = '7'
;
run;

proc sort data=have;
  by descending y;
run;

proc tabulate data=have;
   class x;
   class y/ order=data;
   format x xcell. y ycell.;
   table y, 
         x *n=' '
         / misstext='0'
   ;
run;
&lt;/PRE&gt;
&lt;P&gt;The 7 x 7 cell boundaries were relatively easy due to the way the data set was made so each variable has values in the [0,7] range. In a more typical fashion you would need to do more work with the formats (and your actual data). This relatively easily is made to match a VALUES option on a graph axis statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sort was so the cell count orientation would match the graph closer.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Nov 2020 00:06:50 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-11-13T00:06:50Z</dc:date>
    <item>
      <title>Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698259#M9475</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to change the size of a scatterplot to show a 7x7 grid (a total of 49 cells), instead of what the scatterplot automatically generates. Can anyone tell me how I can change the amount of squares on the grid?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I'm needing help trying to define how many data points (point count) in each square on the grid by producing a data table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aerianna&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 01:40:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698259#M9475</guid>
      <dc:creator>Aerianna9</dc:creator>
      <dc:date>2020-11-12T01:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698266#M9476</link>
      <description>&lt;P&gt;Example data&lt;/P&gt;
&lt;P&gt;What the boundaries of the cells should be.&lt;/P&gt;
&lt;P&gt;The code of your current scatterplot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Typically scatterplots do not have "cells", so you need to provide some sort of example details.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 01:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698266#M9476</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-12T01:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698269#M9477</link>
      <description>Sure, I can provide more detail.</description>
      <pubDate>Thu, 12 Nov 2020 01:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698269#M9477</guid>
      <dc:creator>Aerianna9</dc:creator>
      <dc:date>2020-11-12T01:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698272#M9478</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-11-11 at 7.54.11 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51581iFE8DB0EB92587DA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-11-11 at 7.54.11 PM.png" alt="Screen Shot 2020-11-11 at 7.54.11 PM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-11-11 at 7.54.42 PM.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51582iA94937E103623BD6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-11-11 at 7.54.42 PM.png" alt="Screen Shot 2020-11-11 at 7.54.42 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 01:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698272#M9478</guid>
      <dc:creator>Aerianna9</dc:creator>
      <dc:date>2020-11-12T01:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698362#M9479</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(123);
do i=1 to 100;
x=rand('uniform')*6;
y=rand('uniform')*6;
output;
end;
run;

proc sgplot data=have;
scatter x=x y=y;
xaxis values=(1 to 7 by 1);
yaxis values=(1 to 7 by 1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2020 12:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698362#M9479</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-11-12T12:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698555#M9481</link>
      <description>This was helpful for the grid. Now I'm needing help with the point count for each grid cell. Any ideas?</description>
      <pubDate>Thu, 12 Nov 2020 23:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698555#M9481</guid>
      <dc:creator>Aerianna9</dc:creator>
      <dc:date>2020-11-12T23:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698557#M9482</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/356105"&gt;@Aerianna9&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This was helpful for the grid. Now I'm needing help with the point count for each grid cell. Any ideas?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One way is to create a custom format for each range of value with the desired boundaries for cells. Then apply that format in procedure to count things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;An example using &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s example data set modified to create "nicer" cell boundaries:&lt;/P&gt;
&lt;PRE&gt;data have;&lt;BR /&gt;call streaminit(123);&lt;BR /&gt;do i=1 to 100;&lt;BR /&gt;x=rand('uniform')*7;&lt;BR /&gt;y=rand('uniform')*7;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;proc format;
value xcell
0 -&amp;lt;1 = '1'
1 -&amp;lt;2 = '2'
2 -&amp;lt;3 = '3'
3 -&amp;lt;4 = '4'
4 -&amp;lt;5 = '5'
5 -&amp;lt;6 = '6'
6 -&amp;lt;7 = '7'
;
value ycell
0 -&amp;lt;1 = '1'
1 -&amp;lt;2 = '2'
2 -&amp;lt;3 = '3'
3 -&amp;lt;4 = '4'
4 -&amp;lt;5 = '5'
5 -&amp;lt;6 = '6'
6 -&amp;lt;7 = '7'
;
run;

proc sort data=have;
  by descending y;
run;

proc tabulate data=have;
   class x;
   class y/ order=data;
   format x xcell. y ycell.;
   table y, 
         x *n=' '
         / misstext='0'
   ;
run;
&lt;/PRE&gt;
&lt;P&gt;The 7 x 7 cell boundaries were relatively easy due to the way the data set was made so each variable has values in the [0,7] range. In a more typical fashion you would need to do more work with the formats (and your actual data). This relatively easily is made to match a VALUES option on a graph axis statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sort was so the cell count orientation would match the graph closer.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Nov 2020 00:06:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698557#M9482</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-11-13T00:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot Help!</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698837#M9484</link>
      <description>Thank you so very much, you've been a great help!</description>
      <pubDate>Sat, 14 Nov 2020 00:23:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Scatterplot-Help/m-p/698837#M9484</guid>
      <dc:creator>Aerianna9</dc:creator>
      <dc:date>2020-11-14T00:23:44Z</dc:date>
    </item>
  </channel>
</rss>

