Learn R Programming

saemix (version 1.2)

SaemixData-class: Class "SaemixData"

Description

An object of the SaemixData class, representing a longitudinal data structure, used by the SAEM algorithm.

Arguments

Objects from the Class

An object of the SaemixData class can be created by using the function saemixData

Slots

name.data:

Object of class "character": name of the dataset

header:

Object of class "logical": whether the dataset/file contains a header. Defaults to TRUE

sep:

Object of class "character": the field separator character

na:

Object of class "character": a character vector of the strings which are to be interpreted as NA values

name.group:

Object of class "character": name of the column containing the subject id

name.predictors:

Object of class "character": name of the column(s) containing the predictors

name.response:

Object of class "character": name of the column containing the response variable y modelled by predictor(s) x

name.covariates:

Object of class "character": name of the column(s) containing the covariates, if present (otherwise empty)

name.X:

Object of class "character": name of the column containing the regression variable to be used on the X axis in the plots

units:

Object of class "list": 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

data:

Object of class "data.frame": dataframe containing the data, with columns for id (name.group), predictors (name.predictors), response (name.response), and covariates if present in the dataset (name.covariates). A column "index" contains the subject index (used to map the subject id). The column names, except for the additional column index, correspond to the names in the original dataset.

N:

Object of class "numeric": number of subjects

yorig:

Object of class "numeric": response data, on the original scale. Used when the error model is exponential

ntot.obs:

Object of class "numeric": total number of observations

nind.obs:

Object of class "numeric": vector containing the number of observations for each subject

Methods

[<-

signature(x = "SaemixData"): replace elements of object

[

signature(x = "SaemixData"): access elements of object

initialize

signature(.Object = "SaemixData"): internal function to initialise object, not to be used

plot

signature(x = "SaemixData"): plot the data

print

signature(x = "SaemixData"): prints details about the object (more extensive than show)

read.saemixData

signature(object = "SaemixData"): internal function, not to be used

showall

signature(object = "SaemixData"): shows all the elements in the object

show

signature(object = "SaemixData"): prints details about the object

summary

signature(object = "SaemixData"): summary of the data. Returns a list with a number of elements extracted from the dataset (N: the number of subjects; nobs: the total number of observations; nind.obs: a vector giving the number of observations for each subject; id: subject ID; x: predictors; y: response, and, if present in the data, covariates: the covariates (as many lines as observations) and ind.covariates: the individual covariates (one line per individual).

subset

signature(object = "SaemixData"): extract part of the data; this function will operate on the rows of the dataset (it can be used for instance to extract the data corresponding to the first ten subjects)

References

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

Run this code
# NOT RUN {
showClass("SaemixData")

# Specifying column names
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")

# Specifying column numbers
data(theo.saemix)
saemix.data<-saemixData(name.data=theo.saemix,header=TRUE,sep=" ",na=NA,
  name.group=1,name.predictors=c(2,3),name.response=c(4), name.covariates=5:6, 
  units=list(x="hr",y="mg/L",covariates=c("kg","-")), name.X="Time")

# No column names specified, using automatic recognition of column names
data(PD1.saemix)
saemix.data<-saemixData(name.data=PD1.saemix,header=TRUE, 
  name.covariates=c("gender"),units=list(x="mg",y="-",covariates=c("-")))
# }

Run the code above in your browser using DataLab