search for: touse3

Displaying 1 result from an estimated 1 matches for "touse3".

Did you mean: touser
2012 Feb 17
2
(subscript) logical subscript too long in using apply
...a)){ med[m_j]<-median(data[,m_j])} for(m_j in 1:ncol(data)) for(m_i in 1:nrow(data)) { if(data[m_i,m_j]>med[m_j]) med_ge[m_i,m_j]=0 else med_ge[m_i,m_j]=1 } y=c(1,1,1,1,1,1,0,0,0,0) n<-c(sum(y == 1),sum(y==0)) touse3 <- y==1 T1<- apply(med_ge[touse3,], 2, mean) T0<- apply(med_ge[!touse3,], 2, mean) T=rbind(T1,T0) Tbar=colMeans(T) Tdiff=T-Tbar cov_rank=cov(med_ge) inv_cov_rank=ginv(cov_rank) LN=0 for(m_i in 1:length(n)) { LN <- LN+((Tdiff[m_i,]%*%inv_cov...