# Independent groups t-test on multiple groups

**URL:** <https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614>\
**Category:** KNIME Analytics Platform\
**Created:** [March 9, 2020, 5:38pm UTC](https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614 "2020-03-09T17:38:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![z\_thiel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/e9a140/32.png) [@z\_thiel](https://forum.knime.com/u/z_thiel)\
**Post date:** [March 9, 2020, 5:38pm UTC](https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614/1 "2020-03-09T17:38:44Z")

</div>

Hello,

since I got excellent help with solving my last problem, I thought I would return with another question:

I performed a screen with a series of variables (each with many replicates), including a negative control. After normalization to the negative control (I figured out how to do that), I would like to calculate p-values using the “independent groups t-test” node between the negative control and each variable and eventually visualize the results in a volcano plot.

I have a table that looks something like this:

variable / value  
A / 0.8  
A / 0.7  
B / 2.1  
B / 2.0  
B / 2.8  
C / 0.3  
C / 0.2  
C / 0.4  
negative control / 1.0  
negative control / 1.1  
negative control / 0.9

and I would like to transform it into a table like that:

variable / p-value (between variable and negative control)  
A / 0.1  
B / 0.001  
C / 0.001

In the configuration of the “independent groups t-test” node, I can only select two groups so I tried to loop over the individual variables using a grouped loop (as suggested in this thread: [Paired t-test](https://forum.knime.com/t/paired-t-test/14392)). Here, I failed to select the correct “group one” and “group two”, since these always change while the loop is executed.

Do you have any suggestions?

---

<div class="post-metadata">

**Author:** ![AlexanderFillbrunn](https://forum-cdn.knime.com/user_avatar/forum.knime.com/alexanderfillbrunn/32/357_2.png) [@AlexanderFillbrunn](https://forum.knime.com/u/AlexanderFillbrunn)\
**Post date:** [March 10, 2020, 11:06am UTC](https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614/2 "2020-03-10T11:06:55Z")

</div>

Hi @z_thiel,  
the trick is to use [flow variables](https://www.knime.com/wiki/flow-variables) in the configuration of the [Independent groups t-test](https://kni.me/n/LfKWJOtOdNhm8JCj) node. The [Group Loop Start](https://kni.me/n/7a8fxq51Z1jrgXeM) outputs the current group values as flow variables and in the Independent groups t-test’s dialog under the flow variables tab you can assign that flow variable’s value to group 1. I have attached a workflow for you that should get you started.  
Kind regards  
Alexander

[grouped-t-test.knwf](https://forum.knime.com/uploads/short-url/hfhOMt3b1Jp4fLb3HHWkv2Q6yOB.knwf) (19.5 KB)

---

<div class="post-metadata">

**Author:** ![z\_thiel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/z/e9a140/32.png) [@z\_thiel](https://forum.knime.com/u/z_thiel)\
**Post date:** [March 11, 2020, 2:41pm UTC](https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614/3 "2020-03-11T14:41:44Z")

</div>

Yes that is exactly what I needed. Thank you very much!

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [April 3, 2020, 9:11am UTC](https://forum.knime.com/t/independent-groups-t-test-on-multiple-groups/21614/4 "2020-04-03T09:11:46Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
