Skip to content
Prev 275669 / 398506 Next

FOR loop with statistical analysis for microarray data

thanks for the replies.... so, i remove the indices pv[i] and
fc[i]..but when i run it like this:
===============
fc=0
pv=0
for (i in 1:nrow(data))
{
	
	v1= c(y1[i,1], y1[i,2])	
	v2= c(y2[i,1], y2[1,2])
	fc=v1-v2
	w=t.test(v1,v2)
	pv=w$p.value
}

results = cbind(row.names(y1), fc, pv)

head(results)
=================

i get

===========
Warning message:
In cbind(row.names(y1), fc, pv) :
  number of rows of result is not a multiple of vector length (arg 2)
=============

and the "fc" values are repeated over until the end of the rows and
the "pv" is the same all across the samples...how can i fix it?!

...i apologize if it's a silly situation but i'm new to this and can't
get my head around it!

thanks so much!!
On Thu, Oct 27, 2011 at 9:02 AM, Weidong Gu <anopheles123 at gmail.com> wrote: