Learn R Programming

saemix (version 3.3)

saemixData: Function to create an SaemixData object

Description

This function creates an 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

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,
  automatic = TRUE
)

Value

An SaemixData object (see saemixData).

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

automatic

a boolean indicating whether to attempt automatic name recognition when some colum names are missing or wrong (defaults to TRUE)

Author

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

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.

References

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

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

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

See Also

SaemixData,SaemixModel, saemixControl,saemix

Examples

Run this code

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)

Run the code above in your browser using DataLab