<?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: Formula for normalizing data to control mean in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/586295#M79192</link>
    <description>&lt;P&gt;Thanks jthi, I took your example and wrote the formula equation for Column 3 so the normalization, it all happens in that column as follows,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Column 2&amp;nbsp;/ Col Mean( If( :Column 1&amp;nbsp;== 0, :Column 2, . ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't need to create a local variable.&amp;nbsp; The Col Mean function apparently does that in the background.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your insight!&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vince&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jan 2023 20:36:59 GMT</pubDate>
    <dc:creator>Vince_Kramer</dc:creator>
    <dc:date>2023-01-05T20:36:59Z</dc:date>
    <item>
      <title>Formula for normalizing data to control mean</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/584399#M79028</link>
      <description>&lt;P&gt;Here's the very simple situation I have:&lt;/P&gt;&lt;P&gt;Column A: Continuous data on treatment levels in an experiment.&amp;nbsp; 0 = controls&lt;/P&gt;&lt;P&gt;Column B: Continuous data that is the response metric to the treatment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column C: Formula that calculates response metric from Column B normalized (i.e. divided by) the mean of the responses in the controls (rows where Column A=0).&lt;/P&gt;&lt;P&gt;How do I write the formula in Column C to do this normalization of Column B to the control mean?&lt;/P&gt;&lt;P&gt;I think it will involve creating a local variable that uses the Col Mean function conditional to the Rows in Column A that are = 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to make that conditional work for the multiple rows that need to be selected for calculation of the mean of the controls.&lt;/P&gt;&lt;P&gt;I know that the Col Mean function calculates the mean of all the data in Column B, and that using a By variable can calculate means for each value of Column A. But, I want to calculate a single mean for the values of Column B where Column A are = 0 and use that single mean as an argument in Column C for calculating an equation (Column C=Column B/Mean of Column B where Column A=0) in every row of the table.&lt;/P&gt;&lt;P&gt;I'm using JMP 16.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:58:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/584399#M79028</guid>
      <dc:creator>Vince_Kramer</dc:creator>
      <dc:date>2023-06-10T23:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for normalizing data to control mean</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/584422#M79032</link>
      <description>&lt;P&gt;One option is to use If statement inside the Col Mean&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Col Mean(If(:Column 1 == 0, :Column 2, .))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1671641336711.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/48600i620F373FF42723E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1671641336711.png" alt="jthi_0-1671641336711.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If Column A has &lt;U&gt;&lt;STRONG&gt;first&lt;/STRONG&gt; &lt;/U&gt;row as 0 you can also use &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/programming-functions.shtml?os=win&amp;amp;source=application#ww5032467" target="_blank" rel="noopener"&gt;As Constant()&lt;/A&gt; to calculate the mean&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;As Constant(Col Mean(:Column 2, :Column 1))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have attached example table with both mean calculations. You can of course just take the mean calculation and use that then in single column which will calculate your final data.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 16:52:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/584422#M79032</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-12-21T16:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Formula for normalizing data to control mean</title>
      <link>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/586295#M79192</link>
      <description>&lt;P&gt;Thanks jthi, I took your example and wrote the formula equation for Column 3 so the normalization, it all happens in that column as follows,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;:Column 2&amp;nbsp;/ Col Mean( If( :Column 1&amp;nbsp;== 0, :Column 2, . ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't need to create a local variable.&amp;nbsp; The Col Mean function apparently does that in the background.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate your insight!&amp;nbsp; Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vince&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2023 20:36:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Formula-for-normalizing-data-to-control-mean/m-p/586295#M79192</guid>
      <dc:creator>Vince_Kramer</dc:creator>
      <dc:date>2023-01-05T20:36:59Z</dc:date>
    </item>
  </channel>
</rss>

