<?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 Replacing NAs with Randomly generated numbers in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707396#M89177</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to JMP and I am working with a dataset of measured element concentrations that have a few non-detects labelled as "ND" scattered throughout the dataset. I have been instructed to replace all of the ND's with&amp;nbsp;a value randomly drawn from a uniform distribution&lt;BR /&gt;between 0 and the daily limit of detection (LOD) by a two-point calibration. I have the values for the various LODs for each element, I am simply stuck with the problem of implementing the generation of random numbers to populate in place of the NDs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2023 23:26:09 GMT</pubDate>
    <dc:creator>LossEffectPuma9</dc:creator>
    <dc:date>2023-12-08T23:26:09Z</dc:date>
    <item>
      <title>Replacing NAs with Randomly generated numbers</title>
      <link>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707396#M89177</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to JMP and I am working with a dataset of measured element concentrations that have a few non-detects labelled as "ND" scattered throughout the dataset. I have been instructed to replace all of the ND's with&amp;nbsp;a value randomly drawn from a uniform distribution&lt;BR /&gt;between 0 and the daily limit of detection (LOD) by a two-point calibration. I have the values for the various LODs for each element, I am simply stuck with the problem of implementing the generation of random numbers to populate in place of the NDs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 23:26:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707396#M89177</guid>
      <dc:creator>LossEffectPuma9</dc:creator>
      <dc:date>2023-12-08T23:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing NAs with Randomly generated numbers</title>
      <link>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707437#M89178</link>
      <description>&lt;P&gt;Welcome to the Community.&amp;nbsp; Here is a little script that will show you one approach on changing the NA values to a random value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

LOD = 99;  // Change to be the actual LOD value
randomMean = Mean( 0, LOD );
randomSTD = (LOD - randomMean) / 3;
col = "Age";   // Change to the actual column name

For Each Row(
	If( As Column( col ) == "NA",
		randomVal = LOD + 1;  // Set the target value outside of the acceptable range
		While( 0 &amp;lt; randomVal | randomVal &amp;gt; LOD, randomVal = Random Normal( randomMean, randomSTD ) );
		As Column( col ) = Char( randomVal );
	)
);

// Convert column to numeric
Column( col ) &amp;lt;&amp;lt; data type( numeric ) &amp;lt;&amp;lt; modeling type( continuous );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 09 Dec 2023 02:16:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707437#M89178</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-12-09T02:16:40Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing NAs with Randomly generated numbers</title>
      <link>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707958#M89215</link>
      <description>&lt;P&gt;You can expect great help from others with implementing your idea. I want to address the validity of the approach in the first place. This scheme is one of many &lt;EM&gt;ad hoc&lt;/EM&gt; approaches without rigor or theoretical support. It will bias the answers. It might seem like selecting a replacement value from a random uniform distribution [0...LOD] would prevent bias. It will not.&lt;/P&gt;
&lt;P&gt;A principled, rigorous approach is to tread the LOD as a left-censored observation (i.e., an upper bound on the true value) and use maximum likelihood estimation for the analysis. JMP does not provide the MLE for everything, but it does for many analyses. What kind of analysis were you planning for this data?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 18:36:44 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Replacing-NAs-with-Randomly-generated-numbers/m-p/707958#M89215</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2023-12-11T18:36:44Z</dc:date>
    </item>
  </channel>
</rss>

