<?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: How to impute a random distribution for missing values, within a specified range? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596297#M171668</link>
    <description>&lt;P&gt;You can't impute using that method if there is only one variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is wrong with using 2.5 as the imputed value? Or a random number generator?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 15:14:38 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-10-14T15:14:38Z</dc:date>
    <item>
      <title>How to impute a random distribution for missing values, within a specified range?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596293#M171667</link>
      <description>&lt;P&gt;Hello, on SAS 9.4, I am trying to impute values falling below the limit of detection (LOD) for a laboratory variable (measles antibody titers). All values below 5.00 are &amp;lt;LOD. Rather than impute these as LOD/2 = 2.5, is there some proc I can use to impute a random distribution for this specific variable, between a specified range: 0 to 5?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did try setting all values "&amp;lt;5.00" to missing (".") in a new variable, &lt;FONT face="courier new,courier"&gt;measles_imp&lt;/FONT&gt;, and running the below code - &amp;amp; found an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN&gt;&lt;STRONG&gt;mi&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;=temp &lt;SPAN&gt;out&lt;/SPAN&gt;=measlesimp &lt;SPAN&gt;minimum&lt;/SPAN&gt; = &lt;SPAN&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN&gt;maximum&lt;/SPAN&gt; = &lt;SPAN&gt;&lt;STRONG&gt;5&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;mcmc&lt;/SPAN&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; measles_imp;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;ERROR: Fewer than two analysis variables.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only want to do this for the one variable, so not sure what to do here. &lt;STRONG&gt;Proc hpimpute&lt;/STRONG&gt; does not seem to have an option to specify the range (0-5).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596293#M171667</guid>
      <dc:creator>slh277</dc:creator>
      <dc:date>2019-10-14T15:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to impute a random distribution for missing values, within a specified range?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596297#M171668</link>
      <description>&lt;P&gt;You can't impute using that method if there is only one variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is wrong with using 2.5 as the imputed value? Or a random number generator?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:14:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596297#M171668</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-14T15:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to impute a random distribution for missing values, within a specified range?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596306#M171676</link>
      <description>&lt;P&gt;Thank you for your response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plotting the residuals of both log-transformed and non-transformed data, there is a "boundary line" due to the n=36 values set to 2.5. A biostatistician recommended that I consider doing random values within 0-5 rather than setting values at 2.5 to get a better data structure/distribution (see attached of log-transformed data).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I could use a random number generator, but was hoping to do this more automatically in SAS - Sorry I may be missing something, can SAS randomly generate those values and then automatically fill them into the missing value of the variable?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596306#M171676</guid>
      <dc:creator>slh277</dc:creator>
      <dc:date>2019-10-14T15:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to impute a random distribution for missing values, within a specified range?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596307#M171677</link>
      <description>&lt;P&gt;A data step can replace missings with random numbers. Example:&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 missing(measles_imp) then measles_imp=rand('uniform',0,5);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Oct 2019 15:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596307#M171677</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-14T15:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to impute a random distribution for missing values, within a specified range?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596319#M171680</link>
      <description>Thank you - this is perfect!</description>
      <pubDate>Mon, 14 Oct 2019 16:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-impute-a-random-distribution-for-missing-values-within-a/m-p/596319#M171680</guid>
      <dc:creator>slh277</dc:creator>
      <dc:date>2019-10-14T16:22:36Z</dc:date>
    </item>
  </channel>
</rss>

