<?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: p gain method in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/p-gain-method/m-p/776646#M38042</link>
    <description>&lt;P&gt;It's about table lookup skill and if statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input Variable$ var1$ var2$ p_value p_gain;
  cards;
A1_B1 A1 B1 0.02 .
A1_B2 A1 B2 0.3 .
A1 A1 . 0.06 .
A2 A2 . 1 .
B1 . B1 0.0007 .
;
run;

data want;
  set test;

  if find(Variable,'_') then do;
    do i = 1 to rec;
      set test(keep=Variable p_value rename=(Variable=tmpVariable p_value=tmppvalue))nobs=rec point=i;
      if var1 = tmpVariable then var1pvalue = tmppvalue;
      if var2 = tmpVariable then var2pvalue = tmppvalue;
    end;
    if . &amp;lt; var1pvalue &amp;lt; p_value then p_gain = var1pvalue/p_value;
    if . &amp;lt; var2pvalue &amp;lt; p_value then p_gain = var2pvalue/p_value;
  end;
  drop tmp:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Oct 2021 01:04:21 GMT</pubDate>
    <dc:creator>whymath</dc:creator>
    <dc:date>2021-10-27T01:04:21Z</dc:date>
    <item>
      <title>p gain method</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/p-gain-method/m-p/775877#M38016</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i am working with the p-gain method and wondering if someone has experience with the the method.&lt;/P&gt;&lt;P&gt;My data is build up like this and has the Variable name and p-values from single-variable correlations (A1 to An; B1 to Bn) and ratio-correlations (A1_B1 to An_Bn):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variable&amp;nbsp;&amp;nbsp; var1&amp;nbsp;&amp;nbsp; var2&amp;nbsp;&amp;nbsp;&amp;nbsp; p_value&amp;nbsp;&amp;nbsp; p_gain&lt;/P&gt;&lt;P&gt;A1_B1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.02&lt;/P&gt;&lt;P&gt;A1_B2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06&lt;/P&gt;&lt;P&gt;A2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;P&gt;B1 &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B1 &amp;nbsp;&amp;nbsp;&amp;nbsp; 0.0007&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Where "variable" is a ratio between the two variables "var1" and "var2". For the p-gain method and therefore the new variable p_gain, I want to calculate the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- If the p-value from the first part of the ratio, so here &lt;STRONG&gt;var1&lt;/STRONG&gt; (f.e. A1= 0.06) &lt;STRONG&gt;is smaller&lt;/STRONG&gt; than the p-value from the whole ratio (A1_B1 =0.02) then the p_gain-value should be calculated as p_value(A1) / p-value (A1_B1)&lt;/P&gt;&lt;P&gt;-&amp;nbsp; If the p-value from the second part of the ratio, so here &lt;STRONG&gt;var2&lt;/STRONG&gt; (f.e. B1= 0.0007) &lt;STRONG&gt;is smaller&lt;/STRONG&gt; than the p-value from the whole ratio (A1_B1 =0.02) then the p_gain-value should be calculated as p_value(B1) / p-value (A1_B1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 14:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/p-gain-method/m-p/775877#M38016</guid>
      <dc:creator>u58497688</dc:creator>
      <dc:date>2021-10-22T14:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: p gain method</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/p-gain-method/m-p/776646#M38042</link>
      <description>&lt;P&gt;It's about table lookup skill and if statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  input Variable$ var1$ var2$ p_value p_gain;
  cards;
A1_B1 A1 B1 0.02 .
A1_B2 A1 B2 0.3 .
A1 A1 . 0.06 .
A2 A2 . 1 .
B1 . B1 0.0007 .
;
run;

data want;
  set test;

  if find(Variable,'_') then do;
    do i = 1 to rec;
      set test(keep=Variable p_value rename=(Variable=tmpVariable p_value=tmppvalue))nobs=rec point=i;
      if var1 = tmpVariable then var1pvalue = tmppvalue;
      if var2 = tmpVariable then var2pvalue = tmppvalue;
    end;
    if . &amp;lt; var1pvalue &amp;lt; p_value then p_gain = var1pvalue/p_value;
    if . &amp;lt; var2pvalue &amp;lt; p_value then p_gain = var2pvalue/p_value;
  end;
  drop tmp:;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Oct 2021 01:04:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/p-gain-method/m-p/776646#M38042</guid>
      <dc:creator>whymath</dc:creator>
      <dc:date>2021-10-27T01:04:21Z</dc:date>
    </item>
  </channel>
</rss>

