nlme.run: Run an nlme object augmented with model trail info

View source: R/nlme.run.r

nlme.runR Documentation

Run an nlme object augmented with model trail info

Description

wrapper function for nlme model "method", and which adds a problem description (like $PROB in NONMEM) and the number of a reference model, the numeric position in the model building trail. This is intended to help building a model trail output in conjunction with nlme.modeltrail.

Usage

## S3 method for class 'run'
nlme(...)

Arguments

...

a vector consisting of an nlme call, a problem statement, and a reference number (to which the run will be compared)

Value

a list with the nlme object and the assocated proble statement and reference number

See Also

nlme.modeltrail, nlme.vpc

Examples

library(nlme)
fm1 = nlme(height ~ SSasymp(age, Asym, R0, lrc),
   data = Loblolly,
   fixed = Asym + R0 + lrc ~ 1,
   random = Asym ~ 1,
   start = c(Asym = 103, R0 = -8.5, lrc = -3.3))
summary(fm1)
fm2 = update(fm1, random = pdDiag(Asym + lrc ~ 1))
summary(fm2)

# Now the same thing but using nlme.run()
fm1 = nlme.run(height ~ SSasymp(age, Asym, R0, lrc),
               data = Loblolly,
               fixed = Asym + R0 + lrc ~ 1,
               random = Asym ~ 1,
               start = c(Asym = 103, R0 = -8.5, lrc = -3.3),
               problem = "Initial model",
               reference = 0
)
summary(fm1$object) # note one must specify "$object" here
fm1$problem
#"Initial model"
fm1$reference
#0
fm2 = nlme.run(height ~ SSasymp(age, Asym, R0, lrc),
               data = Loblolly,
               fixed = Asym + R0 + lrc ~ 1,
               random = pdDiag(Asym + lrc ~ 1),
               start = c(Asym = 103, R0 = -8.5, lrc = -3.3),
               problem = "Different random effect",
               reference = 1
)
summary(fm2$object)
fm2$problem
#"Different random effect"
fm2$reference
#1

qPharmetra/qpToolkit documentation built on May 24, 2023, 8:52 a.m.