<?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 How to detect and Compute the missing value? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108819#M22629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the data below, the Likert scale should be in the range of 1-4.&lt;/P&gt;&lt;P&gt;Therefore, I would like to recode the answer 5 to '.'&lt;/P&gt;&lt;P&gt;But it did not succeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, how can I delete the question that consisted of missing value in SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual data could be find the attachment (DAT file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The editor that I wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA example;&lt;/P&gt;&lt;P&gt;INFILE 'C:\Users\nadzatul.abdullah\Documents\My SAS Files\9.3\example.dat' DLM = '09'x DSD;&lt;/P&gt;&lt;P&gt;INPUT&amp;nbsp; Q1 Q2;&lt;/P&gt;&lt;P&gt;MISS =5;&lt;/P&gt;&lt;P&gt;ARRAY vv(2) Q1 Q2;&lt;/P&gt;&lt;P&gt;DO i=1 TO 2;&lt;/P&gt;&lt;P&gt;IF vv(i)=. THEN DO;&lt;/P&gt;&lt;P&gt;MISS=99 ;&lt;/P&gt;&lt;P&gt;i= 2;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC FREQ;&lt;/P&gt;&lt;P&gt;WHERE miss =5;&lt;/P&gt;&lt;P&gt;TABLES Q1 Q2 ;&lt;/P&gt;&lt;P&gt;RUN ;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA = example;&lt;/P&gt;&lt;P&gt;TITLE 'example';&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output looks like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/2867_pastedImage_6.png" style="width: 329px; height: 460px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Dec 2012 08:23:04 GMT</pubDate>
    <dc:creator>najiah</dc:creator>
    <dc:date>2012-12-27T08:23:04Z</dc:date>
    <item>
      <title>How to detect and Compute the missing value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108819#M22629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the data below, the Likert scale should be in the range of 1-4.&lt;/P&gt;&lt;P&gt;Therefore, I would like to recode the answer 5 to '.'&lt;/P&gt;&lt;P&gt;But it did not succeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, how can I delete the question that consisted of missing value in SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The actual data could be find the attachment (DAT file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The editor that I wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA example;&lt;/P&gt;&lt;P&gt;INFILE 'C:\Users\nadzatul.abdullah\Documents\My SAS Files\9.3\example.dat' DLM = '09'x DSD;&lt;/P&gt;&lt;P&gt;INPUT&amp;nbsp; Q1 Q2;&lt;/P&gt;&lt;P&gt;MISS =5;&lt;/P&gt;&lt;P&gt;ARRAY vv(2) Q1 Q2;&lt;/P&gt;&lt;P&gt;DO i=1 TO 2;&lt;/P&gt;&lt;P&gt;IF vv(i)=. THEN DO;&lt;/P&gt;&lt;P&gt;MISS=99 ;&lt;/P&gt;&lt;P&gt;i= 2;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;PROC FREQ;&lt;/P&gt;&lt;P&gt;WHERE miss =5;&lt;/P&gt;&lt;P&gt;TABLES Q1 Q2 ;&lt;/P&gt;&lt;P&gt;RUN ;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA = example;&lt;/P&gt;&lt;P&gt;TITLE 'example';&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output looks like this:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jiveImage" src="https://communities.sas.com/legacyfs/online/2867_pastedImage_6.png" style="width: 329px; height: 460px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2012 08:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108819#M22629</guid>
      <dc:creator>najiah</dc:creator>
      <dc:date>2012-12-27T08:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and Compute the missing value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108820#M22630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's not entirely clear what you are trying to achieve, but it will be easy no matter what.&amp;nbsp; If you really wanted to delete observations, use a DELETE statement.&amp;nbsp; You don't need values of 5 or 99 to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if q1=. then delete;&lt;/P&gt;&lt;P&gt;if q2=. then delete;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could always incorporate this into the array logic that you are using now if you have many variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to delete, but merely want to omit some observations from analysis, you could try a WHERE statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables q1 q2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where n(of q1-q2)=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2013 22:31:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108820#M22630</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-01-03T22:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and Compute the missing value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108821#M22631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds from the words like you just want to convert the 5's to missing values.&amp;nbsp; I am not sure what the 99's have to do with it.&lt;/P&gt;&lt;P&gt;For your simple example you just want something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt; infile 'example.dat';&lt;/P&gt;&lt;P&gt; input q1 q2 ;&lt;/P&gt;&lt;P&gt; if q1=5 then q1=.;&lt;/P&gt;&lt;P&gt; if q2=5 then q2=.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to distinquish the "5" values from the actual missing values then use one of SAS special missing values instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt; infile 'example.dat';&lt;/P&gt;&lt;P&gt; input q1 q2 ;&lt;/P&gt;&lt;P&gt; if q1=5 then q1=.M;&lt;/P&gt;&lt;P&gt; if q2=5 then q2=.M;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To see the result use the MISSPRINT option on PROC FREQ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq ;&lt;/P&gt;&lt;P&gt; tables q1 q2 / missprint;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 01:21:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108821#M22631</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-01-04T01:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to detect and Compute the missing value?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108822#M22632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you for your help, It works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2013 12:39:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-detect-and-Compute-the-missing-value/m-p/108822#M22632</guid>
      <dc:creator>najiah</dc:creator>
      <dc:date>2013-01-04T12:39:40Z</dc:date>
    </item>
  </channel>
</rss>

