Dear ALL I cannot run this line stat.obs <- apply (GS, 2, function(z) Hott2(t(DATA[which(z==1),]), cl)) Error in Hott2 (t(DATA[which(z == 1), ]), cl) : subscript out of bounds I will be glade if you guide me. ******************************************************************************* *GS is a matrix 1857*200 *DATA is a matrix 1857*79 *cl <- as.factor(y) *y<-*c(1,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,1,0*,0,1,1,1,0,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,0,1,0,1,1) *Hott2 <- function(x, y, var.equal=TRUE) ******************************************************************************** Best Regards, [[alternative HTML version deleted]]
On Sat, Mar 5, 2011 at 4:08 PM, Stat Consult <statconsult90@gmail.com>wrote:> Dear ALL > > I cannot run this line > > stat.obs <- apply (GS, 2, function(z) Hott2(t(DATA[which(z==1),]), cl)) > > Error in Hott2 (t(DATA[which(z == 1), ]), cl) : subscript out of bounds > > I will be glade if you guide me. > > > ******************************************************************************* > > *GS is a matrix 1857*200 > > *DATA is a matrix 1857*79 > > *cl <- as.factor(y) > > > *y<-*c(1,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,1,0*,0,1,1,1,0,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,0,1,0,1,1) > > *Hott2 <- function(x, y, var.equal=TRUE) > > > ******************************************************************************** > > Best Regards, >[[alternative HTML version deleted]]
On Mar 5, 2011, at 7:41 AM, Stat Consult wrote:> On Sat, Mar 5, 2011 at 4:08 PM, Stat Consult > <statconsult90 at gmail.com>wrote: > >> Dear ALL >> >> I cannot run this line >> >> stat.obs <- apply (GS, 2, function(z) Hott2(t(DATA[which(z==1),]), >> cl)) >> >> Error in Hott2 (t(DATA[which(z == 1), ]), cl) : subscript out of >> bounds >> >> I will be glade if you guide me. >> >> >> ******************************************************************************* >> >> *GS is a matrix 1857*200 >> >> *DATA is a matrix 1857*79 >> >> *cl <- as.factor(y) >> >> >> *y<- >> *c >> (1,0,1,0,1,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,1,0,1,0 >> *,0,1,1,1,0,1,1,1,1,0,1,0,0,0,1,0,1,1,1,1,0,1,0,1,1) >> >> *Hott2 <- function(x, y, var.equal=TRUE)What were you intending that Hott2 return? At the moment I see no function body. -- David Winsemius, MD Heritage Laboratories West Hartford, CT