<?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: ROUND function in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460255#M5458</link>
    <description>&lt;P&gt;Is that a trick question? The minimum is zero because the lowest value is zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to do to remove the zeros?&lt;/P&gt;
&lt;P&gt;The ROUND() with&amp;nbsp;precision&amp;nbsp;of 0.01 will convert values below 0.005 to zero.&amp;nbsp; It won't remove them.&lt;/P&gt;
&lt;P&gt;How do you want to remove the zeros?&amp;nbsp; Do you want to delete the observation?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 0=abs(round(salary,0.01)) then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you want to change them to missing?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 0=abs(round(salary,0.01)) then call missing(salary);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 05 May 2018 17:18:04 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2018-05-05T17:18:04Z</dc:date>
    <item>
      <title>ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460249#M5455</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to get rid of values of 0 for the variable I am running PROC MEANS on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You'll notice that, after deleting salary data with observations of 0, I still had very low values that are close to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;GENDER	Method	N	Mean	Std Dev	Std Err	Minimum	Maximum
FEMALE	 	        528  873.5	327.3	14.2444	0.00100	 2000.0
MALE	 	      1315 824.4	429.1	3.7423	0	 8100.0
Diff (1-2)	Pooled	 	49.0313	425.7	18.8933	 	 
Diff (1-2)	Satterthwaite	49.0313	 	         14.7278&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;suggested that I use the ROUND function to eliminate these values, but I am having trouble piecing the code together. Here's my attempt so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;*round really small numbers to  zero;
data practice.CompuStat_Execucomp3;
	set practice.CompuStat_Execucomp2;
	ROUND (SALARY &amp;lt;0&amp;gt; );
run; &lt;/PRE&gt;&lt;P&gt;and the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 70         
 71         *round really small numbers to  zero;
 72         data practice.CompuStat_Execucomp3;
 73         set practice.CompuStat_Execucomp2;
 74         ROUND (SALARY &amp;lt;0&amp;gt; );
                               _
                               390
                               76
 ERROR: Undeclared array referenced: ROUND.
 ERROR 390-185: Expecting an relational or arithmetic operator.
 
 ERROR 76-322: Syntax error, statement will be ignored.
 
 75         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set PRACTICE.COMPUSTAT_EXECUCOMP3 may be incomplete.  When this step was stopped there were 0 observations and 
          107 variables.
 WARNING: Data set PRACTICE.COMPUSTAT_EXECUCOMP3 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              2296.37k
       OS Memory           35772.00k
       Timestamp           05/05/2018 02:51:07 PM
       Step Count                        62  Switch Count  0
       Page Faults                       0
       Page Reclaims                     323
       Page Swaps                        0
       Voluntary Context Switches        34
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           8
       
 
 76         
 77         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 89         
 User: apmorabito0&lt;/PRE&gt;&lt;P&gt;If you have any suggestion please let me know. Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 14:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460249#M5455</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-05T14:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460251#M5456</link>
      <description>&lt;P&gt;You just have a syntax error.&amp;nbsp; What you typed doesn't look like code for SAS or any other language.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ROUND (SALARY &amp;lt;0&amp;gt; )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The function call does not look like a function call. Plus you need to use the function in a valid place. Like an assignment statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ROUND() function takes two arguments. The value to be rounded and the level&amp;nbsp;of rounding.&amp;nbsp; So if you want to round to the hundredths place you would use round(sample,0.01).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;salary = round(salary,0.01);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 15:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460251#M5456</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-05-05T15:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460253#M5457</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;, thanks for that. My results are still showing a minimum of 0. Do you know why this would be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*round really small numbers to  zero;
data practice.CompuStat_Execucomp3;
	set practice.CompuStat_Execucomp2;
	salary = round(salary,0.01);
run; 

*remove zeros;
data practice.CompuStat_Execucomp3;
	set practice.CompuStat_Execucomp3; 
	if salary=. then delete;
run;

title "Table 6. Difference in Means";
title2 "Male and Female CEOs";
proc ttest data=practice.CompuStat_Execucomp3;
class gender;
   var salary;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 05 May 2018 16:13:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460253#M5457</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-05T16:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460255#M5458</link>
      <description>&lt;P&gt;Is that a trick question? The minimum is zero because the lowest value is zero.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you want to do to remove the zeros?&lt;/P&gt;
&lt;P&gt;The ROUND() with&amp;nbsp;precision&amp;nbsp;of 0.01 will convert values below 0.005 to zero.&amp;nbsp; It won't remove them.&lt;/P&gt;
&lt;P&gt;How do you want to remove the zeros?&amp;nbsp; Do you want to delete the observation?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 0=abs(round(salary,0.01)) then delete;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Do you want to change them to missing?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 0=abs(round(salary,0.01)) then call missing(salary);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 17:18:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460255#M5458</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-05-05T17:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460256#M5459</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;pointed out that it is unlikely that a CEO would take a salary of 0, and so these (probably missing values) would unjustifiably be underestimating the mean for salary. For that reason, I think it makes most sense to just delete the observations with values for salary of 0.&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 17:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460256#M5459</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-05T17:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460257#M5460</link>
      <description>&lt;P&gt;Interestingly, the mean for men is still&amp;nbsp;&lt;SPAN&gt;0.0600 . So odd . . . maybe I should dig around in the code book so see how these are coded? This is in thousands of dollars, so that would be an annual salary of $60 . . .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 05 May 2018 17:29:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460257#M5460</guid>
      <dc:creator>sastuck</dc:creator>
      <dc:date>2018-05-05T17:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: ROUND function</title>
      <link>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460329#M5470</link>
      <description>&lt;P&gt;It’s been a fad lately to see CEO taking 0 salary, but it’s actually correct. Their renumeration is in stock shares or as a percent of profits instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 May 2018 22:30:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/ROUND-function/m-p/460329#M5470</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-06T22:30:40Z</dc:date>
    </item>
  </channel>
</rss>

