Rick, Thanks so much for responding. Actually I already learned the unique_by statement trick from one of your earlier posts and it is amazing! Believe it or not, it's the actual indexing statement that is tripping me up. I already have the ESTS matrix split into submatrices by sample no. I just can't get the correct observations pulled from it. I'll show you some of the code: read all var{sample lo hi} into worklim; use thirdsorted; read all var{sample mc3estimates} into workests; unique_rows400=uniqueby(workests,1,1:nrow(workests)); do k=1 to nrow(unique_rows400); if k=nrow(unique_rows400) then index=unique_rows400 :nrow(workests); else index=unique_rows400 :unique_rows400[k+1]-1; submat400=workests[index,]; print submat400; end; I am struggling with something like------ confint=j(nrow(worklim),2,0); confint[i,1:2]=workests[worklim,worklim[i,2]]; Thanks for your help Rick! Rachel
... View more