initialize-methods: Methods for Function initialize

initialize-methodsR Documentation

Methods for Function initialize

Description

Constructor functions for Classes in the saemix package

Usage

## S4 method for signature 'SaemixData'
initialize(
  .Object,
  name.data,
  header,
  sep,
  na,
  name.group,
  name.predictors,
  name.response,
  name.covariates,
  name.X,
  units,
  name.mdv,
  name.cens,
  name.occ,
  name.ytype,
  verbose = TRUE,
  automatic = TRUE
)

## S4 method for signature 'SaemixRepData'
initialize(.Object, data = NULL, nb.chains = 1)

## S4 method for signature 'SaemixSimData'
initialize(.Object, data = NULL, datasim = NULL)

## S4 method for signature 'SaemixModel'
initialize(
  .Object,
  model,
  description,
  modeltype,
  psi0,
  name.response,
  name.sigma,
  transform.par,
  fixed.estim,
  error.model,
  covariate.model,
  covariance.model,
  omega.init,
  error.init,
  name.modpar,
  verbose = TRUE
)

## S4 method for signature 'SaemixRes'
initialize(
  .Object,
  status = "empty",
  modeltype,
  name.fixed,
  name.random,
  name.sigma,
  fixed.effects,
  fixed.psi,
  betaC,
  betas,
  omega,
  respar,
  cond.mean.phi,
  cond.var.phi,
  mean.phi,
  phi,
  phi.samp,
  parpop,
  allpar,
  MCOV
)

## S4 method for signature 'SaemixObject'
initialize(.Object, data, model, options = list())

Arguments

.Object

an SaemixObject, SaemixRes, SaemixData or SaemixModel object to initialise

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.covariates

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

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)

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)

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

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)

data

an SaemixData object

nb.chains

number of chains used in the algorithm

datasim

dataframe containing the simulated data

model

name of the function used to compute the structural model. The function should return a vector of predicted values given a matrix of individual parameters, a vector of indices specifying which records belong to a given individual, and a matrix of dependent variables (see example below).

description

a character string, giving a brief description of the model or the analysis

modeltype

a character string giving the model used for analysis

psi0

a matrix with a number of columns equal to the number of parameters in the model, and one (when no covariates are available) or two (when covariates enter the model) giving the initial estimates for the fixed effects. The column names of the matrix should be the names of the parameters in the model, and will be used in the plots and the summaries. When only the estimates of the mean parameters are given, psi0 may be a named vector.

name.sigma

a vector of character string giving the names of the residual error parameters (defaults to "a" and "b")

transform.par

the distribution for each parameter (0=normal, 1=log-normal, 2=probit, 3=logit). Defaults to a vector of 1s (all parameters have a log-normal distribution)

fixed.estim

whether parameters should be estimated (1) or fixed to their initial estimate (0). Defaults to a vector of 1s

error.model

type of residual error model (valid types are constant, proportional, combined and exponential). Defaults to constant

covariate.model

a matrix giving the covariate model. Defaults to no covariate in the model

covariance.model

a square matrix of size equal to the number of parameters in the model, giving the variance-covariance matrix of the model: 1s correspond to estimated variances (in the diagonal) or covariances (off-diagonal elements). Defaults to the identity matrix

omega.init

a square matrix of size equal to the number of parameters in the model, giving the initial estimate for the variance-covariance matrix of the model. The current default is a diagonal matrix with ones for all transformed parameters as well as for all untransformed parameters with an absolute value smaller than one. For untransformed parameters greater or equal to one, their squared value is used as the corresponding diagonal element.

error.init

a vector of size 2 giving the initial value of a and b in the error model. Defaults to 1 for each estimated parameter in the error model

name.modpar

names of the model parameters, if they are not given as the column names (or names) of psi0

status

string indicating whether a model has been run successfully; set to "empty" at initialisation, used to pass on error messages or fit status

name.fixed

a character string giving the name of the fixed parameters

name.random

a character string giving the name of the random parameters

fixed.effects

vector with the estimates of h(mu) and betas in estimation order

fixed.psi

vector with the estimates of h(mu)

betaC

vector with the estimates of betas (estimated fixed effects for covariates)

betas

vector with the estimates of mu

omega

estimated variance-covariance matrix

respar

vector with the estimates of the parameters of the residual error

cond.mean.phi

matrix of size (number of subjects) x (nb of parameters) containing the conditional mean estimates of the, defined as the mean of the conditional distribution

cond.var.phi

matrix of the variances on cond.mean.phi, defined as the variance of the conditional distribution

mean.phi

matrix of size (number of subjects) x (nb of parameters) giving for each subject the estimates of the population parameters including covariate effects

phi

matrix of size (number of subjects) x (nb of parameters) giving for each subject

phi.samp

samples from the individual conditional distributions of the phi

parpop

population parameters at each iteration

allpar

all parameters (including covariate effects) at each iteration

MCOV

design matrix C

options

a list of options passed to the algorithm

Methods

list("signature(.Object = \"SaemixData\")")

create a SaemixData object. Please use the saemixData function.

list("signature(.Object = \"SaemixModel\")")

create a SaemixModel object Please use the saemixModel function.

list("signature(.Object = \"SaemixObject\")")

create a SaemixObject object. This object is obtained after a successful call to saemix

list("signature(.Object = \"SaemixRepData\")")

create a SaemixRepData object

list("signature(.Object = \"SaemixRes\")")

create a SaemixRes object

list("signature(.Object = \"SaemixSimData\")")

create a SaemixSimData object


saemix documentation built on May 29, 2024, 10:43 a.m.