<?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: SGPLOT - histogram and correlation scatter plot customization in SAS Software for Learning Community</title>
    <link>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868900#M1077</link>
    <description>&lt;DIV class=""&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_blank" rel="noopener"&gt;ballardw&lt;/A&gt;,&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;thank you very much!&lt;/DIV&gt;&lt;DIV class=""&gt;Now my code is working perfectly for "Growth Histograms" and I understand the data type&amp;nbsp;&lt;SPAN&gt;Percent7.2&lt;/SPAN&gt; thanks to you:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ods excel file='/home/u63376027/Export/Growth_Histogram.xlsx' style=seaside;
title'Growth Rate Histogram';
proc sgplot data=STPSAMP.STPEURO;
histogram growth;
density growth/ type=normal;
xaxis grid values= (-0.04 to 0.04 by 0.001);
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Unfortunately my code is not working for the correlation plot with Pearson Correlation Coefficient calculation. Maybe I have a wrong sintax somewhere :((&lt;/DIV&gt;&lt;DIV class=""&gt;I see you understand how the code is working,&amp;nbsp; could you please tell me where is my bug?&lt;/DIV&gt;&lt;DIV class=""&gt;I will really appreciate your help.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc corr data=STPSAMP.STPEURO plots = scatter (nvar = all);
var pop growth;
ods output = want;
run;

proc sgplot data = want;
scatter x = pop y = growth
yaxis grid values= (-0.04 to 0.04 by 0.001);
run;&lt;/CODE&gt;&lt;/PRE&gt;Best,&lt;/DIV&gt;&lt;DIV class=""&gt;Eli&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Mon, 10 Apr 2023 17:26:56 GMT</pubDate>
    <dc:creator>elena1234</dc:creator>
    <dc:date>2023-04-10T17:26:56Z</dc:date>
    <item>
      <title>SGPLOT - histogram and correlation scatter plot customization</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868857#M1075</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am a newbie to SAS programming and sgplot customization.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will really appreciate if somebody help me with my assignements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the first:&lt;/P&gt;&lt;P&gt;I have a table which contains a variable with format PERCENT7.2 and when I am trying to create a histogram (by default) the results is plot with bins: (4)%&amp;nbsp; (2)% 0% 2% 4% on the x axis. This is a problem because the values for this variable in my table are something like these: "0.26%, 0.17%, 0.25%, 0.11, 3.5%" and in this order I need&amp;nbsp; to plot on the x axis more bins and maybe between 0.05%.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my poor attemp:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sgplot data=STPSAMP.STPEURO;
histogram growth;
density growth/ type=normal;
xaxis grid values= (-4 to 4 by 0.05);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The results obviously is not what I am expecting for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second assignement:&lt;/P&gt;&lt;P&gt;I need to find the correlation between birth (on the x axis) and growth (on the y axis). My code&amp;nbsp; is working perfectly, but again on my y axis the values for growth variable are:&amp;nbsp;(4)%&amp;nbsp; (2)% 0% 2% 4%. And in this case&amp;nbsp;I need&amp;nbsp; to plot on the y axis more bins and maybe between 0.05%.&lt;/P&gt;&lt;P&gt;My code without customization:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc corr data=STPSAMP.STPEURO plots = scatter (nvar = all);
var birth growth;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've already read the SAS documentation about SGPLOT x and y statements, but nothing is working for me.&lt;/P&gt;&lt;P&gt;Please, help me!&lt;/P&gt;&lt;P&gt;Best!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 14:12:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868857#M1075</guid>
      <dc:creator>elena1234</dc:creator>
      <dc:date>2023-04-10T14:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT - histogram and correlation scatter plot customization</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868880#M1076</link>
      <description>&lt;P&gt;If the format is indeed Percent7.2 then the value that displays as 4% is a decimal 0.04. So you need to use the DECIMAL range values in the Values option list and adjust the BY value to match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;xaxis grid values= (-0.04 to 0.04 by 0.005);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your issue with the plots in Proc Corr are a bit different. There are not a lot of options that you can override in most of the analysis procedure plots, such as Proc Corr, as they are expected to be exploratory and nature and do not provide all of the features needed for "camera ready" report or publication plots. Often serious modifications to these plots are either better done directly from Sgplot/Sgpanel or use the ODS OUTPUT to create the plot data set used and then modify to display with SGplot or Sgpanel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 15:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868880#M1076</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-04-10T15:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT - histogram and correlation scatter plot customization</title>
      <link>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868900#M1077</link>
      <description>&lt;DIV class=""&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_blank" rel="noopener"&gt;ballardw&lt;/A&gt;,&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;thank you very much!&lt;/DIV&gt;&lt;DIV class=""&gt;Now my code is working perfectly for "Growth Histograms" and I understand the data type&amp;nbsp;&lt;SPAN&gt;Percent7.2&lt;/SPAN&gt; thanks to you:&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;ods excel file='/home/u63376027/Export/Growth_Histogram.xlsx' style=seaside;
title'Growth Rate Histogram';
proc sgplot data=STPSAMP.STPEURO;
histogram growth;
density growth/ type=normal;
xaxis grid values= (-0.04 to 0.04 by 0.001);
run;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Unfortunately my code is not working for the correlation plot with Pearson Correlation Coefficient calculation. Maybe I have a wrong sintax somewhere :((&lt;/DIV&gt;&lt;DIV class=""&gt;I see you understand how the code is working,&amp;nbsp; could you please tell me where is my bug?&lt;/DIV&gt;&lt;DIV class=""&gt;I will really appreciate your help.&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc corr data=STPSAMP.STPEURO plots = scatter (nvar = all);
var pop growth;
ods output = want;
run;

proc sgplot data = want;
scatter x = pop y = growth
yaxis grid values= (-0.04 to 0.04 by 0.001);
run;&lt;/CODE&gt;&lt;/PRE&gt;Best,&lt;/DIV&gt;&lt;DIV class=""&gt;Eli&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 10 Apr 2023 17:26:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Software-for-Learning/SGPLOT-histogram-and-correlation-scatter-plot-customization/m-p/868900#M1077</guid>
      <dc:creator>elena1234</dc:creator>
      <dc:date>2023-04-10T17:26:56Z</dc:date>
    </item>
  </channel>
</rss>

