longst: Function for longitudinal starting values

Description Usage Arguments Value

View source: R/longst.R

Description

Internal function to estimate the starting values for the EM algorithm for the longitudinal sub-model

Usage

1
2
longst(longdat, long.formula.orig, long.rand.ind, long.rand.stud = NULL,
  longdat2, id.name, study.name, studies)

Arguments

longdat

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

long.formula.orig

the original longitudinal formula as supplied to the function call

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

longdat2

the longitudinal dataset, without factors expanded into dummy variables, ordered by increasing survival time

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

studies

the names of the studies present in the supplied data

Value

A list of results from the separate longitudinal fit is returned. The elements of this list are:

beta1

a data frame containing the estimates of the fixed effects from the longitudinal sub-model

sigma.e

the estimate of the variance for the measurement error variance for the longitudinal model

D

a data frame containing the estimate of the covariance matrix for the individual level random effects

log.like.long

the log-likelihood for the separate longitudinal model

randstart.ind

the conditional modes of the individual level random effects given the data and the parameter estimates from the separate longitudinal model. The data frame has number of columns equal to the number of individual level random effects, and the number of rows equal to the number of individuals in the dataset

randstart.ind.cov

a list of the conditional covariance matrices for each individual for the individual level random effects. The list is of length equal to the number of individuals in the dataset. Each element of the list is a matrix of dimensions equal to the number of study level random effects in the model.

A

a data frame containing the estimate of the covariance matrix for the study level random effects. This is present in the results only if study level random effects are included in the model.

randstart.stud

the conditional modes of the study level random effects given the data and the parameter estimates from the separate longitudinal model. The data frame has number of columns equal to the number of study level random effects, and number of rows equal to the number of studies in the dataset. This is present in the results only if study level random effects are included in the model.

randstart.stud.cov

a list of the conditional covariance matrices for each study for the study level random effects. The list is of length equal to the number of studies in the dataset. Each element of the list is a matrix of dimensions equal to the number of study level random effects in the model. This is present in the results only if study level random effects are included in the model.

modelfit

the initial longitudinal model fit, fitted using the lmer function


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