<?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: Generate variable that shows three or more of the questions are missing. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833064#M82043</link>
    <description>&lt;P&gt;Following your description id=1 must have complete = 1 because 8 item-variables are non-missing.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 08:24:01 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-09-13T08:24:01Z</dc:date>
    <item>
      <title>Generate variable that shows three or more of the questions are missing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833052#M82042</link>
      <description>Hi&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;We currently have 2 surveys (Survey_One and Survey_two). Survey_one contains 11 questions (item 1 to 11) and survey_two contains 10 questions (item 1 to 10). &amp;amp;nbsp;I want to create a variable that indicate a survey is considered complete if 9 of 11 questions are not missing for survey_one and if 8 of 10 questions for suverve_two are not missing. &amp;amp;nbsp;(Variable name e.g: complete (1=yes, 0=no)).&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;For example,&lt;BR /&gt;person_ID=1 completed Survey_one and item1 to item3 are missing and so complete=0&lt;BR /&gt;person_ID=2 completed Survey_one and none of the questions/items are missing and so complete=1&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;Below is a sample of the data.&lt;BR /&gt;person_ID item1 item2 item3 item4 item5 item6 item7 item8 item9 item10 item11 Survey_number&lt;BR /&gt;1 . . . 2 2 3 3 3 2 0 0 Survey_One&lt;BR /&gt;2 1 3 0 0 4 1 4 3 4 3 3 Survey_One&lt;BR /&gt;3 0 0 0 0 0 0 2 2 0 0 0 Survey_One&lt;BR /&gt;4 1 2 1 1 1 1 3 3 2 1 1 Survey_One&lt;BR /&gt;5 1 0 0 0 0 0 0 1 2 0 . Survey_two&lt;BR /&gt;6 0 0 0 0 0 0 0 0 1 0 . Survey_two&lt;BR /&gt;7 0 2 0 0 0 0 3 3 1 0 . Survey_two&lt;BR /&gt;8 0 0 0 . 0 . 1 . 1 1 . Survey_two&lt;BR /&gt;9 0 1 0 0 0 0 1 0 0 0 . Survey_two&lt;BR /&gt;10 1 3 3 0 2 . . 0 2 3 . Survey_two&lt;BR /&gt;11 2 0 4 0 0 3 1 2 0 0 . Survey_two&lt;BR /&gt;&amp;amp;nbsp;&lt;BR /&gt;Thanks</description>
      <pubDate>Tue, 13 Sep 2022 09:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833052#M82042</guid>
      <dc:creator>Sofia2022</dc:creator>
      <dc:date>2022-09-13T09:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Generate variable that shows three or more of the questions are missing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833064#M82043</link>
      <description>&lt;P&gt;Following your description id=1 must have complete = 1 because 8 item-variables are non-missing.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 08:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833064#M82043</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-09-13T08:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Generate variable that shows three or more of the questions are missing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833074#M82044</link>
      <description>Apologies there was an error in my post which I corrected now. ID=1 completed survey_one that contains 11 questions item1 to item11, where 3 of the items are missing and so complete=0.</description>
      <pubDate>Tue, 13 Sep 2022 09:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833074#M82044</guid>
      <dc:creator>Sofia2022</dc:creator>
      <dc:date>2022-09-13T09:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Generate variable that shows three or more of the questions are missing.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833079#M82045</link>
      <description>&lt;P&gt;UNTESTED CODE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    if survey_number="Survey_One" then complete=nmiss(of item1-item11)&amp;lt;=2;
    else if survey_number='Survey_Two' then complete=nmiss(of item1-item10)&amp;lt;=2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want tested code, please provide data as &lt;FONT color="#FF0000"&gt;working&lt;/FONT&gt; SAS data step code.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 11:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Generate-variable-that-shows-three-or-more-of-the-questions-are/m-p/833079#M82045</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-13T11:21:09Z</dc:date>
    </item>
  </channel>
</rss>

