EMalgRandprop: EM algorithm function used in jointmeta1

Description Usage Arguments Value See Also

View source: R/EMalgRandprop.R

Description

Function to run EM algorithm during one stage model fit. Used when the jointmeta1 function is called.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
EMalgRandprop(
  data,
  longdat,
  survdat,
  long.rand.ind,
  long.rand.stud = NULL,
  id.name,
  study.name,
  gpt,
  max.it,
  tol,
  time.long,
  surv.formula,
  long.formula,
  long.formula.orig,
  paraests,
  studies,
  p1,
  p2,
  strat,
  print.detail,
  bootrun = FALSE,
  q,
  r = NULL
)

Arguments

data

the original jointdata as supplied to the jointmeta1] call

longdat

the longitudinal data with factors and interaction terms expanded, ordered by increasing survival time

survdat

the survival data with factors and interaction terms expanded, ordered by increasing survival time

long.rand.ind

a vector of character strings to indicate what variables to assign individual level random effects to. A maximum of three individual level random effects can be assigned. To assign a random intercept include 'int' in the vector. To not include an individual level random intercept include 'noint' in the vector. For example to fit a model with individual level random intercept and random slope set long.rand.ind = c('int', 'time'), where 'time' is the longitudinal time variable in the data.

long.rand.stud

a vector of character strings to indicate what variables to assign study level random effects to. If no study level random effects then this either not specified in function call or set to NULL. If a study level random intercept is required, include the name of the study membership variable for example long.rand.stud = 'study'.

id.name

character string specifying the id variable in the dataset

study.name

a character string denoting the name of the variable in the baseline dataset in data holding study membership, for example study.name = 'study'.

gpt

the number of quadrature points across which the integration with respect to the random effects will be performed. If random effects are specified at both the individual and the study level, the same number of quadrature points is used in both cases. Defaults to gpt = 5.

max.it

the maximum number of iterations of the EM algorithm that the function will perform. Defaults to max.it = 350 although more iterations could be required for large complex datasets.

tol

the tolerance level used to determine convergence in the EM algorithm. Defaults to tol = 0.001.

time.long

the name of the variable holding the longitudinal time covariate

surv.formula

a formula object with the survival time, censoring indicator and the covariates to include in the survival sub-model. The response must be a survival object as returned by the Surv function.

long.formula

a formula object with the response varaible, and the covariates to include in the longitudinal sub-model

long.formula.orig

the original longitudinal formula as supplied to the function call

paraests

a list of the estimates present from the separate longitudinal and survival fits. Same structure as sepests if requested in a jointmeta1.object

studies

the names of the studies present in the supplied data

p1

the number of fixed effects included in the longitudinal sub-model

p2

the number of fixed effects included in the survival sub-model

strat

logical value: if TRUE then the survival sub-model is calculated with a baseline stratified by study. Otherwise baseline is unstratified

print.detail

logical value: if TRUE then details of the parameter estimates at each iteration of the EM algorithm are printed to the console.

bootrun

logical value: if TRUE then the log-likelihood for the model is not calculated. This option is available so that when bootstrapping to obtain standard errors, as the log-likelihood is not needed, it is not calculated, thus speeding up the bootstrapping process.

q

the number of individual level random effects

r

the number of study level random effects, set to NULL if no study level random effects included in the model

Value

This function returns a list of the estimates of parameters and other information from the run of the EM algorithm. The list has the following components:

beta1

a data frame containing the estimates of the fixed effect parameters from the longitudinal sub-model.

beta2

a data frame containing the estimates of the fixed effect parameters from the survival sub-model.

sigma.e

the estimate of the variance of the measurement errors.

haz

the estimated baseline hazard. If strat = TRUE in the function call to jointmeta1 then this is a list of length equal to the number of studies in the supplied dataset, each element of the list being the baseline hazard for the corresponding study. Otherwise there is a common baseline across all studies in the dataset and this is one vector.

D

the estimated covariance matrix for the individual level random effects

A

the estimated covariance matrix for the study level random effects. This is only present in the output if study level random effects were specified in the function call to jointmeta1.

random2

a list of matrices containing the conditional modes of the individual level random effects given the supplied data and the estimated parameters of the joint model. The list is of length equal to the number of studies in the dataset, and each element of the list has number of rows equal to the number of individuals in the study, and number of columns equal to the number of specified individual level random effects.

random3

a matrix containing the conditional modes of the study level random effects given the supplied data and the estimated parameters of the joint model. The matrix has number of rows equal to the number of studies, and number of columns equal to the number of specified study level random effects.

long.rand.ind.form

a character string giving the formulation of the individual level random effects.

long.rand.stud.form

a character string giving the formulation of the study level random effects if included in the model.

conv

a logical value indicating whether convergence of the EM algorithm was achieved or not.

iters

the number of iterations completed by the EM algorithm

n.bystudy

the number of individuals present in each study in the data supplied to the function.

See Also

jointmeta1, tojointdata, jointdata,lmer, coxph


mesudell/joineRmeta documentation built on Jan. 24, 2020, 6:06 p.m.