Function to run EM algorithm during one stage model fit. Used when the jointmeta1 function is called.
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
)the original jointdata as supplied to the
jointmeta1] call
the longitudinal data with factors and interaction terms expanded, ordered by increasing survival time
the survival data with factors and interaction terms expanded, ordered by increasing survival time
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.
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'.
character string specifying the id variable in the dataset
a character string denoting the name of the variable in the
baseline dataset in data holding study membership, for example
study.name = 'study'.
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.
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.
the tolerance level used to determine convergence in the EM
algorithm. Defaults to tol = 0.001.
the name of the variable holding the longitudinal time covariate
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.
a formula object with the response varaible, and the covariates to include in the longitudinal sub-model
the original longitudinal formula as supplied to the function call
a list of the estimates present from the separate
longitudinal and survival fits. Same structure as sepests if
requested in a jointmeta1.object
the names of the studies present in the supplied data
the number of fixed effects included in the longitudinal sub-model
the number of fixed effects included in the survival sub-model
logical value: if TRUE then the survival sub-model is
calculated with a baseline stratified by study. Otherwise baseline is
unstratified
logical value: if TRUE then details of the
parameter estimates at each iteration of the EM algorithm are printed to
the console.
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.
the number of individual level random effects
the number of study level random effects, set to NULL if no
study level random effects included in the model
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:
beta1a data frame containing the estimates of the fixed effect parameters from the longitudinal sub-model.
beta2a data frame containing the estimates of the fixed effect parameters from the survival sub-model.
sigma.ethe estimate of the variance of the measurement errors.
hazthe 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.
Dthe estimated covariance matrix for the individual level random effects
Athe 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.
random2a 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.
random3a 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.forma character string giving the formulation of the individual level random effects.
long.rand.stud.forma character string giving the formulation of the study level random effects if included in the model.
conva logical value indicating whether convergence of the EM algorithm was achieved or not.
itersthe number of iterations completed by the EM algorithm
n.bystudythe number of individuals present in each study in the data supplied to the function.