# [R] HELP with NLME

From: Loki Natarajan <loki_at_math.ucsd.edu>
Date: Wed 26 Jul 2006 - 08:52:01 EST

Hi,

Sincerely,
Loki

```#################################################################
```
SAS Code:

proc nlmixed data=repdat
parms b0 -3 b1 -.135 a0 3 a1 4 sigsq 0.25;

if vs.flag = 1 then do;

eta1 = b0 + b1*lnbldT;
llbin = anybc.cens.ind*eta1 - log(1+exp(eta1));     eta2 = a0 + a1*lnndsTs;
llnorm = -1/(2*sigsq)*(lnbldT - eta2)**2 - .5*log(sigsq);     ll = llbin + llnorm;
end;

else do;

eta2 = a0 + a1*lnndsTs;
eta1 = b0 + b1*eta2 + u;
llbin = anybc.cens.ind*eta1 - log(1+exp(eta1));     ll = llbin;
end;

sigma2 = sigmasq*b1**2 /*variance of random effect; model anybc.cens.indic ~ general(ll);
random u ~ normal(0,sigma2) subject = CaseID; */; run;

```####################################################################
```
R Code with error message:

me.km.nlme <- nlme(model = anybc.cens.indic ~ vs.flag*((anybc.cens.indic*(b0+b1*lnbldT) - log(1 + exp(b0+b1*lnbldT))) + (((-1/(2*sigsq))*(lnbldT -a0 -a1*lnndsTs)^2) - 0.5*log(sigsq))) + (1-vs.flag)*((anybc.cens.indic*(b0+b1*(a0 + a1*lnndsTs + u))) - log(1 + exp(b0+b1*(a0 + a1*lnndsTs + u)))), fixed = list(a0~1,a1~1,b0~1,b1~1,sigsq~1),na.action=na.omit, data=rc.df, method="ML", random=u~1|CaseID,
start = c(a0=0, a1=1, b0=-3, b1 = -0.135, sigsq = 0.25))

+ Error: Singularity in backsolve at level 0, block 1 In addition: There were 16 warnings (use warnings() to see them)
> >
>
> warnings()

Warning messages:

```1: Singular precision matrix in level -1, block 5
2: Singular precision matrix in level -1, block 5
3: Singular precision matrix in level -1, block 5
4: NA/Inf replaced by maximum positive value
5: Singular precision matrix in level -1, block 5
6: Singular precision matrix in level -1, block 5
7: Singular precision matrix in level -1, block 5
8: NA/Inf replaced by maximum positive value
9: NaNs produced in: log(x)
10: NaNs produced in: log(x)
11: NaNs produced in: log(x)
12: NaNs produced in: log(x)
13: NaNs produced in: log(x)
14: NaNs produced in: log(x)
```

15: NaNs produced in: log(x)
16: NaNs produced in: log(x)
>
```#####################################################################

```
```phone:     858 822 4763
Fax:       858 822 6897

______________________________________________
```
R-help@stat.math.ethz.ch mailing list
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. Received on Wed Jul 26 08:59:25 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 02 Aug 2006 - 22:17:57 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.