pair wise comparison, R code, vector
0
0
Entering edit mode
8.4 years ago
anna • 0

Hi all, I want to make pairwise comparisons of 13 data sets (13 independent experiments). As the cell number differs among experiments it is required to correct the data with x value (the ratio of two cell population sizes). The vector cellno <- c(2.3, 0.5, 1.3, 1.0, 1.6, 1.0, 1.0, 0.8, 1.2, 0.6, 0.8, 0.9, 0.9) contains information about cell numbers. So, I select first value from vector (i.e. 2.3) and divide each other number by 2.3 to get x.

n <- cellno [1]
for (i in n:length(cellno)) {print (cellno [i] / n)}

However, I want to calculate x for each pair of conditions one by one so I can then run my comparison function for those conditions. It means that I want to calculate x for condition 1 and 2 then make comparison of these conditions, then calculate x for condition 1 and 3 make comparison, next calculate x for condition 1 and 4 and make comparison etc. When I am done with comparison of condition 1st with other 12 I would like to start the same for the condition 2nd etc. Shall I use for loop? How shall I structure the loop? I will appreciate any suggestions/advices.

R • 1.9k views
ADD COMMENT
1
Entering edit mode

This is an R programming question. Try on StackOverflow. For your problem, use of the apply family of functions comes to mind.

ADD REPLY
0
Entering edit mode

Ok, I posted my question on stackoverflow. I will have a look at apply function, thanks.

ADD REPLY

Login before adding your answer.

Traffic: 1596 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6