<?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: How to calculate average from percentage in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568326#M11652</link>
    <description>&lt;P&gt;"did not work" on its own is useless. Supply the log, example data in usable form, and describe where the result you got differs from your expectations.&lt;/P&gt;
&lt;P&gt;As you can see from this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cleaned_data;
input interest_rate;
format interest_rate percent6.;
datalines;
1
3
4
6
;

PROC MEANS data=Cleaned_data Mean Median Min Max;
var interest_rate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;your code works, as it produces this log:&lt;/P&gt;
&lt;PRE&gt;24         data cleaned_data;
25         input interest_rate;
26         format interest_rate percent6.;
27         datalines;

NOTE: The data set WORK.CLEANED_DATA has 4 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.00 seconds
      
32         ;

33         
34         PROC MEANS data=Cleaned_data Mean Median Min Max;
35         var interest_rate;
36         run;

NOTE: There were 4 observations read from the data set WORK.CLEANED_DATA.
NOTE: The PROCEDURE MEANS printed page 1.
NOTE: PROZEDUR MEANS used (Total process time):
      real time           0.10 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;and this result:&lt;/P&gt;
&lt;PRE&gt;                    Die Prozedur MEANS

             Analysevariable : interest_rate 

 Mittelwert          Median         Minimum         Maximum
-----------------------------------------------------------
  3.5000000       3.5000000       1.0000000       6.0000000
-----------------------------------------------------------
&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Jun 2019 09:43:29 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-06-24T09:43:29Z</dc:date>
    <item>
      <title>How to calculate average from percentage</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568319#M11649</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I have data like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interest_rate&lt;/P&gt;&lt;P&gt;1%&lt;/P&gt;&lt;P&gt;3%&lt;/P&gt;&lt;P&gt;4%&lt;/P&gt;&lt;P&gt;6%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable is defined as a character. How to calculate mean?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used a function like this and it did not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC MEANS data=First.Cleaned_data Mean Median Min Max;&lt;/P&gt;&lt;P&gt;var interest_rate;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Aleksandar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 09:09:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568319#M11649</guid>
      <dc:creator>Aleksandar</dc:creator>
      <dc:date>2019-06-24T09:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average from percentage</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568323#M11650</link>
      <description>Will you please paste the output of PROC MEANS? You have asked PROC MEANS to calculate Median, Minimum and Maximum apart from Mean(Average)?&lt;BR /&gt;Is it running or throwing error? If it is running you will have four outputs.. Please paste the log and output (if any).</description>
      <pubDate>Mon, 24 Jun 2019 09:29:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568323#M11650</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-24T09:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average from percentage</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568325#M11651</link>
      <description>I am sorry. I skipped over the fact that it is defined as character. I would have used a DATA step before PROC MEANS and used an informat/format combination to format the Interest_rate as Number(or percentage) from character. Sorry for glossing over the detail in the question.</description>
      <pubDate>Mon, 24 Jun 2019 09:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568325#M11651</guid>
      <dc:creator>koyelghosh</dc:creator>
      <dc:date>2019-06-24T09:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average from percentage</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568326#M11652</link>
      <description>&lt;P&gt;"did not work" on its own is useless. Supply the log, example data in usable form, and describe where the result you got differs from your expectations.&lt;/P&gt;
&lt;P&gt;As you can see from this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cleaned_data;
input interest_rate;
format interest_rate percent6.;
datalines;
1
3
4
6
;

PROC MEANS data=Cleaned_data Mean Median Min Max;
var interest_rate;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;your code works, as it produces this log:&lt;/P&gt;
&lt;PRE&gt;24         data cleaned_data;
25         input interest_rate;
26         format interest_rate percent6.;
27         datalines;

NOTE: The data set WORK.CLEANED_DATA has 4 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.00 seconds
      
32         ;

33         
34         PROC MEANS data=Cleaned_data Mean Median Min Max;
35         var interest_rate;
36         run;

NOTE: There were 4 observations read from the data set WORK.CLEANED_DATA.
NOTE: The PROCEDURE MEANS printed page 1.
NOTE: PROZEDUR MEANS used (Total process time):
      real time           0.10 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;and this result:&lt;/P&gt;
&lt;PRE&gt;                    Die Prozedur MEANS

             Analysevariable : interest_rate 

 Mittelwert          Median         Minimum         Maximum
-----------------------------------------------------------
  3.5000000       3.5000000       1.0000000       6.0000000
-----------------------------------------------------------
&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 09:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568326#M11652</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-24T09:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate average from percentage</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568328#M11653</link>
      <description>&lt;P&gt;Forget my previous post. I also did not notice that you have a character column (who does such things, in %DEITY's name?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this code for how to convert the column in a preceding step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cleaned_data;
input interest_rate $;
int_rate_num = input(interest_rate,percent6.) * 100;
datalines;
1%
3%
4%
6%
;

PROC MEANS data=Cleaned_data Mean Median Min Max;
var int_rate_num;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 09:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-calculate-average-from-percentage/m-p/568328#M11653</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-24T09:54:35Z</dc:date>
    </item>
  </channel>
</rss>

