From: Dennis Fisher <*fisher*>

Date: Wed, 28 Feb 2018 08:16:45 -0800

Colleagues

I am implementing a linear mixed-effects model in R.

Out of curiosity (and to confirm that I was doing the right thing), I =

wrote the code initially in NONMEM, then tried to replicate the results =

in R.

The dataset is four (identical) treatments for one subject and the data =

are reasonably linear.

For most subjects, the results from the NONMEM analysis are nearly =

identical to those from R.

But, for one subject, the SLOPE/INTERCEPT are sufficiently different to =

concern me that I am implementing one of these (or possibly both) =

incorrectly.

The critical code is:

NONMEM:

$PRED INTERCEPT = THETA(1) + ETA(1)

SLOPE = THETA(2) + ETA(2)

Y = INTERCEPT + SLOPE * TIME + =

EPS(1)

R: LMER package:

lmer(DV ~ TIME + (1|PERIOD), data=DATA, REML=FALSE)

where:

DV is the dependent variable

PERIOD distinguishes the treatments (and is a factor)

R: NLME package:

lme(DV ~ TIME, random = ~ 1|PERIOD, data=DATA, method="ML")

The two R packages yield identical results.

Graphics from NONMEM and R differ slightly but there is no obvious =

preference between these approaches.

Any thoughts as to a possible explanation?

Dennis

Dennis Fisher MD

P < (The "P Less Than" Company)

Phone / Fax: 1-866-PLessThan (1-866-753-7784)

www.PLessThan.com <http://www.plessthan.com/>

Received on Wed Feb 28 2018 - 11:16:45 EST

Date: Wed, 28 Feb 2018 08:16:45 -0800

Colleagues

I am implementing a linear mixed-effects model in R.

Out of curiosity (and to confirm that I was doing the right thing), I =

wrote the code initially in NONMEM, then tried to replicate the results =

in R.

The dataset is four (identical) treatments for one subject and the data =

are reasonably linear.

For most subjects, the results from the NONMEM analysis are nearly =

identical to those from R.

But, for one subject, the SLOPE/INTERCEPT are sufficiently different to =

concern me that I am implementing one of these (or possibly both) =

incorrectly.

The critical code is:

NONMEM:

$PRED INTERCEPT = THETA(1) + ETA(1)

SLOPE = THETA(2) + ETA(2)

Y = INTERCEPT + SLOPE * TIME + =

EPS(1)

R: LMER package:

lmer(DV ~ TIME + (1|PERIOD), data=DATA, REML=FALSE)

where:

DV is the dependent variable

PERIOD distinguishes the treatments (and is a factor)

R: NLME package:

lme(DV ~ TIME, random = ~ 1|PERIOD, data=DATA, method="ML")

The two R packages yield identical results.

Graphics from NONMEM and R differ slightly but there is no obvious =

preference between these approaches.

Any thoughts as to a possible explanation?

Dennis

Dennis Fisher MD

P < (The "P Less Than" Company)

Phone / Fax: 1-866-PLessThan (1-866-753-7784)

www.PLessThan.com <http://www.plessthan.com/>

Received on Wed Feb 28 2018 - 11:16:45 EST