[R] inner loop problem!?

Christian Schulz ozric at web.de
Tue Apr 24 09:29:07 CEST 2007


Hi,

i have  656 attributes ind INTERVALL_VAR & 119 in GROUP
and this morning i'm little confused why the inner loop hang if it 
arrive 656th  column.
My Task is a t-test and correlation with all columns in INTERVALL_VAR 
for all attributes in GROUP.

many thanks & regards,
christian

  for( k in 
1:length(GROUP)){                                                                                        

for(i in 
1:length(INTERVALL_VAR)){                                                                                            

calc <- t.test(INTERVALL_VAR[,i] ~ 
GROUP[,k])                                                                                   

korrel[i] <- 
round(cor(INTERVALL_VAR[,i],GROUP[,k]),3)                                                                          

name1[i] <-   
colnames(INTERVALL_VAR[i])                                                                                      

name2[i] <-   
colnames(GROUP[k])                                                                                       

sig[i] <- 
round(calc$p.value,4)                                                                                      

estimate0[i] <- 
round(calc$estimate[1],2)                                                                            

estimate1[i] <- 
round(calc$estimate[2],2)                                                                            

}                                                                                                                    

}                                                                                                                    

                                                                                                                    

result <- 
as.data.frame(cbind(name1,name2,korrel,sig,estimate0,estimate1),row.names=F)



More information about the R-help mailing list