<?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: Setting some values of a continuous variable to missing randomly in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602086#M174284</link>
    <description>&lt;P&gt;Thanks. It was useful.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Nov 2019 18:18:32 GMT</pubDate>
    <dc:creator>mmovahed</dc:creator>
    <dc:date>2019-11-06T18:18:32Z</dc:date>
    <item>
      <title>Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602070#M174275</link>
      <description>&lt;P&gt;I like to replace some values of a continuous variable to missing by random. I wonder what is the code in SAS for this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also Like to know if I can do multiple imputation for variable with whole missing values based on other variables in the data set. If so I wonder what is SAS codes for this as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602070#M174275</guid>
      <dc:creator>mmovahed</dc:creator>
      <dc:date>2019-11-06T17:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602074#M174278</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298540"&gt;@mmovahed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I like to replace some values of a continuous variable to missing by random. I wonder what is the code in SAS for this.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Seems like an odd thing to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    random=rand('uniform');
    if random&amp;lt;0.2 then x=.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also Like to know if I can do multiple imputation for variable with whole missing values based on other variables in the data set. If so I wonder what is SAS codes for this as well.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look at the examples in the documentation for PROC MI.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602074#M174278</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-06T17:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602086#M174284</link>
      <description>&lt;P&gt;Thanks. It was useful.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 18:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602086#M174284</guid>
      <dc:creator>mmovahed</dc:creator>
      <dc:date>2019-11-06T18:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602188#M174299</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298540"&gt;@mmovahed&lt;/a&gt;:&lt;/P&gt;
&lt;P&gt;The answer depends on whether you&amp;nbsp;want to&amp;nbsp;replace a variable with a missing value:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;in an &lt;EM&gt;exact number&lt;/EM&gt; of observations&lt;/LI&gt;
&lt;LI&gt;approximately in some percentage of observations&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;A program for #1 will be quite different (and more complex - there're different algorithms for doing it) than for #2 at which&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;has hinted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And also it depends on whether every time you run the code you want to:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;get exactly the same results&lt;/LI&gt;
&lt;LI&gt;get different results&lt;/LI&gt;
&lt;LI&gt;pick the observations on run #n all different from run #m&lt;/LI&gt;
&lt;LI&gt;the missing values to be distributed uniformly or in some other manner&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;and possibly a number of other factors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards&lt;/P&gt;
&lt;P&gt;Paul D.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 19:50:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602188#M174299</guid>
      <dc:creator>hashman</dc:creator>
      <dc:date>2019-11-06T19:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602270#M174344</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298540"&gt;@mmovahed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Also Like to know if I can do multiple imputation for variable with whole missing values based on other variables in the data set. If so I wonder what is SAS codes for this as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You may need to describe exactly what you mean by "whole missing values ". That sort of sounds like you have no actual values for a variable. Without at least a few values it is going to be real hard to determine any sort of rule that uses other variables to impute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a categorical variable that should have 4 levels but one of the levels doesn't appear, for example, then what rule would be used to determine the missing should be the category with no representation?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Nov 2019 23:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602270#M174344</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-06T23:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Setting some values of a continuous variable to missing randomly</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602271#M174345</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Thanks for your explanation. You are right. I think we need at least few available values for the variable with missing.&lt;BR /&gt;&lt;BR /&gt;M&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Nov 2019 23:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Setting-some-values-of-a-continuous-variable-to-missing-randomly/m-p/602271#M174345</guid>
      <dc:creator>mmovahed</dc:creator>
      <dc:date>2019-11-06T23:33:19Z</dc:date>
    </item>
  </channel>
</rss>

