<?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: PERCENT OF MISSING BY EACH GROUP VARIABLES in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369858#M88350</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CP=NMISS(OF P01-P10)+N(OF P01-P10);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there straightforward function to count the number of columns instead doing nmiss+n as shown in above code?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jun 2017 13:15:40 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2017-06-23T13:15:40Z</dc:date>
    <item>
      <title>PERCENT OF MISSING BY EACH GROUP VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369764#M88318</link>
      <description>&lt;P&gt;I'd like to get an idea of an extent of missing for each group of questions (variables) in my survey data. P1-P10, B1-B2 and G1-G5 are example of series of questions with missing (no response from study particpants). I believe there is lot more efficient way of doing this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CP=NMISS(OF P01-P10)+N(OF P01-P10);
CB=NMISS(OF B1-B2)+ N(OF B1-B2);
CG=NMISS(OF G1-G5)+ N(OF G1-G5);

NP=NMISS(OF P01-P10);
NB=NMISS(OF B1-B2); 
NG=NMISS(OF G1-G5); &lt;BR /&gt;
P_MISSING_PERCENT=NP/CP*100;
B_MISSING_PERCENT=NB/CB*100;&lt;BR /&gt;G_MISSING_PERCENT=NG/CG*100;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any suggestions please?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 03:01:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369764#M88318</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-06-23T03:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT OF MISSING BY EACH GROUP VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369765#M88319</link>
      <description>&lt;P&gt;Well, I think you can do it in one, but besides that it's the same calculation. I don't think you're saving very much here though.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array p(*) p01-p10;

p_missing = nmiss(of p(*)) / dim(p);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jun 2017 03:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369765#M88319</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-23T03:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT OF MISSING BY EACH GROUP VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369858#M88350</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;CP=NMISS(OF P01-P10)+N(OF P01-P10);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there straightforward function to count the number of columns instead doing nmiss+n as shown in above code?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 13:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/369858#M88350</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-06-23T13:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT OF MISSING BY EACH GROUP VARIABLES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/370028#M88381</link>
      <description>&lt;P&gt;If you are really asking how many variables are in the abbreviated variable list P01-P10, the answer will always be 10. The data step automatically creates the variables if they do not exist already in order to include them in the list.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are looking for an answer to the more general question, I don't know of a function to count the number of variables in a list. It is possible to define an array that contains the variable list, and then the DIM function will count the elements in the array:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;array list(*) p01-p10;
cp = dim(list);&lt;/PRE&gt;
&lt;P&gt;I wouldn't argue that this simplifies anything, though.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 17:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-OF-MISSING-BY-EACH-GROUP-VARIABLES/m-p/370028#M88381</guid>
      <dc:creator>RickAster</dc:creator>
      <dc:date>2017-06-23T17:18:11Z</dc:date>
    </item>
  </channel>
</rss>

