<?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: PROC SQL and PROC UNIVARIATE inconsistency in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460301#M5464</link>
    <description>&lt;P&gt;by coname&lt;/P&gt;</description>
    <pubDate>Sun, 06 May 2018 16:42:43 GMT</pubDate>
    <dc:creator>kiranv_</dc:creator>
    <dc:date>2018-05-06T16:42:43Z</dc:date>
    <item>
      <title>PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460296#M5461</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was looking at the distribution of CEO salaries in my histogram:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Histogram;
title "Figure 1. CEO Salary";
title2 "2010-2017";
PROC UNIVARIATE data=paper.ceo_firm;
	var salary;
	histogram salary/kernel;
	label salary="Salary (thousands)";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and noticed that there appear to be negative values, which obviously doesn't make much sense. To investigate further, I used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*find min;
proc sql;
select * from paper.ceo_firm
having salary = min(salary);
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But found that the minimum salary is 0. Why would this be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will attach a screenshot of the histogram and data, if you don't mind.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-05-06 at 11.23.27 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20379i6E37E149CAF911FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-05-06 at 11.23.27 AM.png" alt="Screen Shot 2018-05-06 at 11.23.27 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-05-06 at 11.24.01 AM.png" style="width: 457px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20380iA2B86D1DEE37F359/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-05-06 at 11.24.01 AM.png" alt="Screen Shot 2018-05-06 at 11.24.01 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 15:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460296#M5461</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-06T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460297#M5462</link>
      <description>&lt;P&gt;your proc sql does not seem right. it is missing group by statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 15:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460297#M5462</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-05-06T15:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460298#M5463</link>
      <description>&lt;P&gt;What do you expect the BY statement would be? I just want to see the lowest salaries in my data set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 15:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460298#M5463</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-06T15:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460301#M5464</link>
      <description>&lt;P&gt;by coname&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 16:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460301#M5464</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-05-06T16:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460305#M5465</link>
      <description>&lt;P&gt;I tried the following, but it never stopped running.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*find min;
proc sql;
select * from paper.ceo_firm 
group by coname
having salary = min(salary);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 May 2018 17:51:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460305#M5465</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-06T17:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460313#M5466</link>
      <description>&lt;P&gt;if you do not want all other columns, just do&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select coname, min(salary) as salary from paper.ceo_firm 
group by coname
quit&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 06 May 2018 19:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460313#M5466</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2018-05-06T19:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460315#M5467</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177874"&gt;@sastuck&lt;/a&gt; wrote: &lt;BR /&gt;
&lt;P&gt;I will attach a screenshot of the histogram and data, if you don't mind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2018-05-06 at 11.23.27 AM.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20379i6E37E149CAF911FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2018-05-06 at 11.23.27 AM.png" alt="Screen Shot 2018-05-06 at 11.23.27 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas? Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The histogram is NOT showing values less than 0. It is showing an axis that goes less than zero, which you can change. The zero values are in the leftmost bar, which straddles 0.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 19:43:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460315#M5467</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-06T19:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460317#M5468</link>
      <description>&lt;P&gt;Oh, problem solved then. I'll accept your post as a solution. However, would you mind showing me how to truncate the x axis so that it stops at 0?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 19:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460317#M5468</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-06T19:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460318#M5469</link>
      <description>&lt;P&gt;I don't believe you have that kind of control over the x-axis levels from PROC UNIVARIATE. You can however control the x-axis of a bar chart using either PROC GCHART or PROC SGPLOT.&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 19:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460318#M5469</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-05-06T19:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL and PROC UNIVARIATE inconsistency</title>
      <link>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460474#M5482</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177874"&gt;@sastuck&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was looking at the distribution of CEO salaries in my histogram:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Histogram;
title "Figure 1. CEO Salary";
title2 "2010-2017";
PROC UNIVARIATE data=paper.ceo_firm;
	var salary;
	histogram salary/kernel;
	label salary="Salary (thousands)";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and noticed that there appear to be negative values, which obviously doesn't make much sense. To investigate further, I used:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*find min;
proc sql;
select * from paper.ceo_firm
having salary = min(salary);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But found that the minimum salary is 0. Why would this be?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will attach a screenshot of the histogram and data, if you don't mind.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I believe we already had one brief discussion about values of zero in your salary data. Why they are there remains a mystery to me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Univariate should also have produced a table with the extremes. The GRAPH generates interval tickmarks based on values of your data. Why it chose to have a -250 relates to the default algorithm used to distribute tick marks for the type graph displayed.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 15:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/PROC-SQL-and-PROC-UNIVARIATE-inconsistency/m-p/460474#M5482</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-07T15:26:45Z</dc:date>
    </item>
  </channel>
</rss>

