
Hi All,

The for-loop below stopped when error("Cannot get confidence intervals on var-cov components: Non-positive definite approximate variance-covariance") occurred.
I assigned a row of NA values 
to the data frame "m1" manually and reset "j" in the for-loop every time error returned. I’m wondering if 
there is a function that can detect error or failure, so the for-loop WILL NOT stop and the NA values can be assigned automatically if specified condition met. This can solve my problem that I need to set the NA values manually and reset j in for-loop every time error returned. Doing this manually would be very tedious.
 m1<-matrix(ncol=3,nrow=0)
for (j in 1:1000){

 fit<-lme(Expression~1,random=~1|MonkeyID, data=mydata1,subset=Probes==as.character(Probes_Blood_sub[j,"probe"]))
 ci<-intervals(fit)$reStruct$MonkeyID^2
 m1<-rbind(m1,ci)}
Thanks,Sityee
 
_________________________________________________________________
The i’m Talkathon starts 6/24/08.  For now, give amongst yourselves.

	[[alternative HTML version deleted]]

