theo.saemix | R Documentation |

The `theo.saemix`

data frame has 132 rows and 6 columns of data from
an experiment on the pharmacokinetics of theophylline. A column with gender was
added to the original data for demo purposes, and contains simulated data.

```
theo.saemix
```

This data frame contains the following columns:

- Id
an ordered factor with levels

`1`

, ...,`12`

identifying the subject on whom the observation was made. The ordering is by time at which the observation was made.- Dose
dose of theophylline administered orally to the subject (mg/kg).

- Time
time since drug administration when the sample was drawn (hr).

- Concentration
theophylline concentration in the sample (mg/L).

- Weight
weight of the subject (kg).

- Sex
gender (simulated, 0=male, 1=female

Boeckmann, Sheiner and Beal (1994) report data from a study by Dr. Robert Upton of the kinetics of the anti-asthmatic drug theophylline. Twelve subjects were given oral doses of theophylline then serum concentrations were measured at 11 time points over the next 25 hours.

These data are analyzed in Davidian and Giltinan (1995) and Pinheiro and Bates (2000) using a two-compartment open pharmacokinetic model.

These data are also available in the library `datasets`

under the name
`Theoph`

in a slightly modified format and including the data at time
0. Here, we use the file in the format provided in the *NONMEM*
installation path (see the User Guide for that software for details).

AJ Boeckmann, LB Sheiner, SL Beal (1994),
*NONMEM Users Guide: Part V*, NONMEM Project Group, University of
California, San Francisco.

M Davidian, DM Giltinan (1995) *Nonlinear Models for Repeated
Measurement Data*, Chapman & Hall (section 5.5, p. 145 and section 6.6, p.
176)

JC Pinheiro, DM Bates (2000) *Mixed-effects Models in S and
S-PLUS*, Springer (Appendix A.29)

```
data(theo.saemix)
#Plotting the theophylline data
plot(Concentration~Time,data=theo.saemix,xlab="Time after dose (hr)",
ylab="Theophylline concentration (mg/L)")
saemix.data<-saemixData(name.data=theo.saemix,header=TRUE,sep=" ",na=NA,
name.group=c("Id"),name.predictors=c("Dose","Time"),
name.response=c("Concentration"),name.covariates=c("Weight","Sex"),
units=list(x="hr",y="mg/L",covariates=c("kg","-")), name.X="Time")
model1cpt<-function(psi,id,xidep) {
dose<-xidep[,1]
tim<-xidep[,2]
ka<-psi[id,1]
V<-psi[id,2]
CL<-psi[id,3]
k<-CL/V
ypred<-dose*ka/(V*(ka-k))*(exp(-k*tim)-exp(-ka*tim))
return(ypred)
}
# Default model, no covariate
saemix.model<-saemixModel(model=model1cpt,
description="One-compartment model with first-order absorption",
psi0=matrix(c(1.,20,0.5,0.1,0,-0.01),ncol=3,byrow=TRUE,
dimnames=list(NULL, c("ka","V","CL"))),transform.par=c(1,1,1))
# Note: remove the options save=FALSE and save.graphs=FALSE
# to save the results and graphs
saemix.options<-list(seed=632545,save=FALSE,save.graphs=FALSE, displayProgress=FALSE)
# Not run (strict time constraints for CRAN)
saemix.fit<-saemix(saemix.model,saemix.data,saemix.options)
# Model with covariates
saemix.model<-saemixModel(model=model1cpt,
description="One-compartment model with first-order absorption",
psi0=matrix(c(1.,20,0.5,0.1,0,-0.01),ncol=3,byrow=TRUE,
dimnames=list(NULL, c("ka","V","CL"))),transform.par=c(1,1,1),
covariate.model=matrix(c(0,0,1,0,0,0),ncol=3,byrow=TRUE),fixed.estim=c(1,1,1),
covariance.model=matrix(c(1,0,0,0,1,1,0,1,1),ncol=3,byrow=TRUE),
omega.init=matrix(c(1,0,0,0,1,0,0,0,1),ncol=3,byrow=TRUE),error.model="combined")
saemix.options<-list(seed=39546,save=FALSE,save.graphs=FALSE,displayProgress=FALSE)
# Not run (strict time constraints for CRAN)
saemix.fit<-saemix(saemix.model,saemix.data,saemix.options)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.