Now I would like to perform some operations and comparisons, and I have an internal control for the experiment in each group that is my treatment "A", so I found that the nicest way to scale is doing:
However what I need is to divide in each group my val2 = (val1 / val1(from treat="A")), because a hand calculations shows me that it makes a difference in the posterior statistical analysis.
I am following different R tutorials, but I do not manage to call that value properly.
If someone could help me with that and a link with a tutorial or something like that to understand the base of "it" (not sure which is the base I need for the answer), I would really appreciate it.
I think you are not clear enough here val2 = (val1 / val1(from treat="A")), do you mean you want to divide val1 by the actual value of val1 of treatment A for each group (1, 2, 3). I am not sure why you used the scale function above in the code.
Something I tried please see below.
Thank you! I think I had a typo when I tried your approach.
To answer your question:
In my code above I tried to normalize or uniform the data to compare it between groups, therefore I used scale() (which I wont use for the later analysis), however I was loosing the "control" sample as reference, then I needed to correct that with exactly what you showed.