<?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: Computing a variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11032#M1165</link>
    <description>Works wonderfully! Thank you for your help.</description>
    <pubDate>Tue, 27 Apr 2010 19:21:38 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-27T19:21:38Z</dc:date>
    <item>
      <title>Computing a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11030#M1163</link>
      <description>I have a dataset that contains a character/string variable (var1). &lt;BR /&gt;
&lt;BR /&gt;
Is there a way to get the counts (in proc freq) to produce another variable in a new dataset? &lt;BR /&gt;
&lt;BR /&gt;
For example, the original dataset: &lt;BR /&gt;
&lt;BR /&gt;
var1&lt;BR /&gt;
a&lt;BR /&gt;
a&lt;BR /&gt;
b&lt;BR /&gt;
c&lt;BR /&gt;
c&lt;BR /&gt;
c&lt;BR /&gt;
&lt;BR /&gt;
proc freq produces output like this: &lt;BR /&gt;
&lt;BR /&gt;
var1 frequency&lt;BR /&gt;
a 2&lt;BR /&gt;
b 1&lt;BR /&gt;
c 3&lt;BR /&gt;
&lt;BR /&gt;
I would like to take the frequency and divide it by another number (ie, 10) to get another variable so that my new dataset looks like this: &lt;BR /&gt;
&lt;BR /&gt;
var1 frequency new_var&lt;BR /&gt;
a 2 0.2&lt;BR /&gt;
b 1 0.1&lt;BR /&gt;
c 3 0.3&lt;BR /&gt;
&lt;BR /&gt;
Any help would be appreciated!</description>
      <pubDate>Tue, 27 Apr 2010 18:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11030#M1163</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-27T18:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Computing a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11031#M1164</link>
      <description>Please try below;&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
input var1 $;&lt;BR /&gt;
cards;&lt;BR /&gt;
a&lt;BR /&gt;
a&lt;BR /&gt;
b&lt;BR /&gt;
c&lt;BR /&gt;
c&lt;BR /&gt;
c&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table b as&lt;BR /&gt;
  select distinct var1, count(var1) as freq, divide(calculated freq,10) as ave&lt;BR /&gt;
  from a&lt;BR /&gt;
  group by var1;&lt;BR /&gt;
quit;</description>
      <pubDate>Tue, 27 Apr 2010 19:12:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11031#M1164</guid>
      <dc:creator>P_J</dc:creator>
      <dc:date>2010-04-27T19:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Computing a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11032#M1165</link>
      <description>Works wonderfully! Thank you for your help.</description>
      <pubDate>Tue, 27 Apr 2010 19:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Computing-a-variable/m-p/11032#M1165</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-27T19:21:38Z</dc:date>
    </item>
  </channel>
</rss>

