s-news
[Top] [All Lists]

Re: NLME loop termination

To: "Pravin" <jadhavpr@vcu.edu>, <s-news@wubios.wustl.edu>
Subject: Re: NLME loop termination
From: "Pete Meyer" <pmeyer4050@csky.net>
Date: Thu, 19 Feb 2004 08:57:27 -0600
References: <002301c3f597$5a5d0be0$170111ac@Pravin>
Usually
    try(expr)
takes care of this kind of problem.  If the expression fails,
try takes care of loose ends and continues with the loop.
If you "try" to do an assignment and it fails, the old value
stays in the to assign variable (which is convenient if it was
NA to start with) and the loop continues.  At the end you
can see how many failed to complete.

Check the documentation on "try".

Pete

----- Original Message ----- 
From: "Pravin" <jadhavpr@vcu.edu>
To: <s-news@wubios.wustl.edu>
Sent: Tuesday, February 17, 2004 2:48 PM
Subject: [S] NLME loop termination


Hello all,

How do I take care of this?

After running an NLME function in the loop, I am extracting fixed effect and
random effect components along with SE estimates on all. (For var-cov
components SE estimates are back calculated from the confidence intervals).
I have a total of 50 datasets to be fitted.

The function runs fine if I am not extracting SE estimates.

But for some datasets SPLUS cannot get confidence intervals on var-cov
components due to non-positive definite approximate variance-covariance and
it terminates the loop.

SPLUS being not able to estimate CI for all is fine with me, but I would
like the loop to continue and get CI for all possible sets. What kind of
exclusion statement should I include so that even though a particular
parameter not available and the loop would continue?

for (i in 1:ntrial)
{

od.fit<-nlme(model),
data=data,
fixed=lncl+lndclm+lnv~1,
random=lncl+lnv~1|id,
start=c(log(clf),log(clm-clf),log(v)),subset=trial==i)

nlmeres[i,]<-as.numeric(c(fixed.effects(od.fit),VarCorr(od.fit)[,2],summary(
od.fit)$tTable[,2],

(intervals(od.fit)$reStruct$id[,2]-intervals(od.fit)$reStruct$id[,1])/1.96))
}


Thanks,

Pravin

Pravin Jadhav


--------------------------------------------------------------------
This message was distributed by s-news@lists.biostat.wustl.edu.  To
unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
the BODY of the message:  unsubscribe s-news


<Prev in Thread] Current Thread [Next in Thread>