<?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: Missing Data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402768#M97844</link>
    <description>I want x2 to be missing on purpose</description>
    <pubDate>Tue, 10 Oct 2017 14:21:25 GMT</pubDate>
    <dc:creator>Wafflecakes</dc:creator>
    <dc:date>2017-10-10T14:21:25Z</dc:date>
    <item>
      <title>Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402756#M97838</link>
      <description>&lt;P&gt;To SAS experts -&amp;nbsp; I have repeated measures data (multiple obs per id) and I am trying to duplicate a variable but only keep values that satisfy a condition:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have&lt;/P&gt;&lt;P&gt;id x x1&lt;/P&gt;&lt;P&gt;1 1 2&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 2 .&lt;/P&gt;&lt;P&gt;1 2 30&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 1 350&lt;/P&gt;&lt;P&gt;2 2 .&lt;/P&gt;&lt;P&gt;2 2 30&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Want&amp;nbsp;&lt;/P&gt;&lt;P&gt;id x x1 x2&lt;/P&gt;&lt;P&gt;1 1 2&amp;nbsp; 2&lt;/P&gt;&lt;P&gt;1 2&amp;nbsp; .&amp;nbsp; &amp;nbsp;.&lt;/P&gt;&lt;P&gt;1 2 30&amp;nbsp; .&lt;/P&gt;&lt;P&gt;2 1 350 350&lt;/P&gt;&lt;P&gt;2 2 . .&lt;/P&gt;&lt;P&gt;2 2 30&amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;data try;&lt;/P&gt;&lt;P&gt;set try;&lt;/P&gt;&lt;P&gt;if x1~=. then x2=x1;&lt;/P&gt;&lt;P&gt;where x1=2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS deletes all of my other observations and only keeps those that follow the if statement - what do I do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402756#M97838</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402757#M97839</link>
      <description>&lt;P&gt;It sounds like you are looking for this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if x1=2 then x2=2;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 13:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402757#M97839</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-10T13:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402759#M97840</link>
      <description>X1 equals values other than 2 like 350 so that wudnt work</description>
      <pubDate>Tue, 10 Oct 2017 14:06:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402759#M97840</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402762#M97841</link>
      <description>&lt;P&gt;You may need to explain a fuller set of rules then.&amp;nbsp; Take the example in your data where X1 is 3.&amp;nbsp; Why is X2 missing, and not 3?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could the solution be as simple as this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x2 = x1;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402762#M97841</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-10T14:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402768#M97844</link>
      <description>I want x2 to be missing on purpose</description>
      <pubDate>Tue, 10 Oct 2017 14:21:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402768#M97844</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402769#M97845</link>
      <description>&lt;P&gt;The purpose of this statement is to remove any observation where the value of X1 is other than 2&lt;/P&gt;
&lt;PRE&gt;where x1=2;&lt;/PRE&gt;
&lt;P&gt;So you told SAS to delete observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Provide a description of the actual rule(s) involved.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:24:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402769#M97845</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-10T14:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402770#M97846</link>
      <description>&lt;P&gt;OK, time for full disclosure then.&amp;nbsp; No secrets allowed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When should X2 be equal to X1?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When should X2 be missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are there any other possibilities?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The programming is easy.&amp;nbsp; You just have to spell out the rules.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402770#M97846</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-10T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402774#M97847</link>
      <description>I modified the original post. Basically you will notice that x can equal 1 or 2. I only want to keep the values of x1 for when x=1 otherwise x2=. even if x1~=.</description>
      <pubDate>Tue, 10 Oct 2017 14:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402774#M97847</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402775#M97848</link>
      <description>I only added the where statement so that the if statement executes in those places and the remainder is meant to be missing.</description>
      <pubDate>Tue, 10 Oct 2017 14:40:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402775#M97848</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402779#M97849</link>
      <description>&lt;P&gt;Assuming I understand correctly, this would do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;if x=1 then x2=x1;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 14:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402779#M97849</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-10-10T14:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402782#M97850</link>
      <description>This is it. Such a simple step i made it so overly complicated.</description>
      <pubDate>Tue, 10 Oct 2017 14:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402782#M97850</guid>
      <dc:creator>Wafflecakes</dc:creator>
      <dc:date>2017-10-10T14:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Missing Data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402935#M97897</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/161013"&gt;@Wafflecakes&lt;/a&gt; wrote:&lt;BR /&gt;I only added the where statement so that the if statement executes in those places and the remainder is meant to be missing.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Where does not work that way. Where subsets data given the rules on the statement. It actually works as data is read and does not matter where in the data step the where statement exists. Unless you have multiple where statements, in which case the last one is likely going to be the one in effect.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 20:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Data/m-p/402935#M97897</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-10T20:02:08Z</dc:date>
    </item>
  </channel>
</rss>

