<?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: duplicate value in proc freq in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549527#M8686</link>
    <description>&lt;P&gt;It worked thank you very much&lt;/P&gt;</description>
    <pubDate>Tue, 09 Apr 2019 09:35:52 GMT</pubDate>
    <dc:creator>Cassie2</dc:creator>
    <dc:date>2019-04-09T09:35:52Z</dc:date>
    <item>
      <title>duplicate value in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549249#M8643</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having some trouble dealing with my data set. First my orginal data FREQ looks like this:&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="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28527iB371FBB32FFE1438/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to clean the data set and turned them into number so I write these codes:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data hth1n18.data;&lt;BR /&gt;set hth1n18.data;&lt;BR /&gt;If Qu_11 = 'Very Low' then Qu_11=1;&lt;BR /&gt;If Qu_11 = 'Ver Low' then Qu_11=1;&lt;BR /&gt;If Qu_11 = 'Very Low &amp;nbsp;' then Qu_11 = 1;&lt;BR /&gt;If Qu_11 = 'Low' then Qu_11 = 2;&lt;BR /&gt;If Qu_11 = 'Medium' then Qu_11 =3;&lt;BR /&gt;If Qu_11 = 'Meduim' then Qu_11 = 3;&lt;BR /&gt;If Qu_11 = 'High' then Qu_11 =4;&lt;BR /&gt;If Qu_11 = 'Very High' then Qu_11 = 5;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now my FREQ looks like this, I have duplicate value in the FREQ table. Also I cannot run the proc means for this variable.&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="Capture.PNG" style="width: 533px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/28528iD640FB492DF2F511/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Proc means show the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;103 Proc Means data=hth1n18.data Maxdec=2 Mean Median Min Max;&lt;BR /&gt;104 var Qu_11;&lt;BR /&gt;ERROR: Variable Qu_11 in list does not match type prescribed for this list.&lt;BR /&gt;105 run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help! Thanks a lot &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 12:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549249#M8643</guid>
      <dc:creator>Cassie2</dc:creator>
      <dc:date>2019-04-08T12:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate value in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549250#M8644</link>
      <description>&lt;P&gt;This happens because&amp;nbsp;Qu_11 is a character variable and you try to use it in a numeric context. Use some other variable name for you numeric representations and use that in your analysis.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 13:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549250#M8644</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-04-08T13:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate value in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549251#M8645</link>
      <description>&lt;P&gt;You cannot change the type for a variable once it is set. So SAS will convert the numbers to strings to store them into the character variable. That is why the numbers in your second PROC FREQ are right aligned instead of left aligned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot take mean of a string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make a new variable.&lt;/P&gt;
&lt;P&gt;Note that trailing spaces are meaningless to SAS. More likely one of the Very Low values has leading spaces instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;If left(Qu_11) = 'Very Low' then Qu_11_num = 1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 13:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549251#M8645</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-04-08T13:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate value in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549527#M8686</link>
      <description>&lt;P&gt;It worked thank you very much&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 09:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549527#M8686</guid>
      <dc:creator>Cassie2</dc:creator>
      <dc:date>2019-04-09T09:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: duplicate value in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549528#M8687</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Apr 2019 09:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/duplicate-value-in-proc-freq/m-p/549528#M8687</guid>
      <dc:creator>Cassie2</dc:creator>
      <dc:date>2019-04-09T09:36:08Z</dc:date>
    </item>
  </channel>
</rss>

