Dear all members I have a problem with the code below when i wanted to change the continuous random variables to mixed ordered categorical and dichotomous as follow
#transform theta to ordinal variables yo <- array(0, dim=c(i,5,100)) for(j in 1:5){ if(v[j] < 0.25){ yo[i,j,t] = 1 }else if(v[j] >=0.25 & v[j] < 0.5){ yo[i,j,t] = 2 }else if(v[j] >=0.5 & v[j] < 0.75){ yo[i,j,t] = 3 }else{ yo[i,j,t] = 4 } }} #transform theta1 to dichotomousvariables for (j in 6:9) { if (v[j]>0) yo[i,j,t]<-1 else yo[i,j,t]<-0 } i found this error *Error in yo[i, j, t] <- 1 : subscript out of bounds* any Guidance would highly appreciated. Regards -- Thanoon Y. Thanoon PhD Candidate Department of Mathematical Sciences Faculty of Science University Technology Malaysia, UTM E.Mail: thanoon.youni...@gmail.com E.Mail: dawn_praye...@yahoo.com Facebook:Thanoon Younis AL-Shakerchy Twitter: Thanoon Alshakerchy H.P:00601127550205 [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.