Displaying 1 result from an estimated 1 matches for "persample".
Did you mean:
oversample
2010 Mar 31
1
How to calculate fold change and its confidence interval
...gt; tb
A A B B
[1,] 860 42 348 36
[2,] 406 31 164 44
[3,] 284 29 115 18
[4,] 46 64 19 85
The fold change can be calculated as
> fc <- apply(tb[,1:2],1,mean) / apply(tb[,3:4],1,mean)
> fc
[1] 2.348958 2.100962 2.353383 1.057692
And the paired fold change should be:
> fc.perSample <- cbind(tb[,1]/tb[,3], tb[,2]/tb[,4])
> fc.perSample
[,1] [,2]
[1,] 2.471264 1.1666667
[2,] 2.475610 0.7045455
[3,] 2.469565 1.6111111
[4,] 2.421053 0.7529412
> rowMeans(fc.perSample)
[1] 1.818966 1.590078 2.040338 1.586997
But if you manually check every gene one by on...