saemixData: Function to create a SaemixData object

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SaemixData.R

Description

This function creates a SaemixData object. The only mandatory argument is the name of the dataset. If the dataset has a header (or named columns), the program will attempt to detect which column correspond to ID, predictor(s) and response. Warning messages will be printed during the object creation and should be read for details.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
saemixData(
  name.data,
  header,
  sep,
  na,
  name.group,
  name.predictors,
  name.response,
  name.X,
  name.covariates = c(),
  name.genetic.covariates = c(),
  name.mdv = "",
  name.cens = "",
  name.occ = "",
  name.ytype = "",
  units = list(x = "", y = "", covariates = c()),
  verbose = TRUE
)

Arguments

name.data

name of the dataset (can be a character string giving the name of a file on disk or of a dataset in the R session, or the name of a dataset

header

whether the dataset/file contains a header. Defaults to TRUE

sep

the field separator character. Defaults to any number of blank spaces ("")

na

a character vector of the strings which are to be interpreted as NA values. Defaults to c(NA)

name.group

name (or number) of the column containing the subject id

name.predictors

name (or number) of the column(s) containing the predictors (the algorithm requires at least one predictor x)

name.response

name (or number) of the column containing the response variable y modelled by predictor(s) x

name.X

name of the column containing the regression variable to be used on the X axis in the plots (defaults to the first predictor)

name.covariates

name (or number) of the column(s) containing the covariates, if present (otherwise missing)

name.genetic.covariates

name (or number) of the column(s) containing the covariates, if present (otherwise missing)

name.mdv

name of the column containing the indicator for missing variable

name.cens

name of the column containing the indicator for censoring

name.occ

name of the column containing the occasion

name.ytype

name of the column containing the index of the response

units

list with up to three elements, x, y and optionally covariates, containing the units for the X and Y variables respectively, as well as the units for the different covariates (defaults to empty)

verbose

a boolean indicating whether messages should be printed out during the creation of the object

Details

This function is the user-friendly constructor for the SaemixData object class. The read.saemixData is a helper function, used to read the dataset, and is not intended to be called directly.

This function is the user-friendly constructor for the SaemixData object class. The read is a helper function, used to read the dataset, and is not intended to be called directly.

Value

A SaemixData object (see saemixData).

Author(s)

Emmanuelle Comets emmanuelle.comets@inserm.fr, Audrey Lavenu, Marc Lavielle.

References

Comets E, Lavenu A, Lavielle M. Parameter estimation in nonlinear mixed effect models using saemix, an R implementation of the SAEM algorithm. Journal of Statistical Software 80, 3 (2017), 1-41.

Kuhn E, Lavielle M. Maximum likelihood estimation in nonlinear mixed effects models. Computational Statistics and Data Analysis 49, 4 (2005), 1020-1038.

Comets E, Lavenu A, Lavielle M. SAEMIX, an R version of the SAEM algorithm. 20th meeting of the Population Approach Group in Europe, Athens, Greece (2011), Abstr 2173.

See Also

SaemixData,SaemixModel, saemixControl,saemix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(theo.saemix)

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")

print(saemix.data)

plot(saemix.data)

saemixdevelopment/saemix documentation built on May 27, 2020, 1:56 p.m.