Description Usage Arguments Value See Also Examples
A function to allow the random effects covariance matrix for a particular
level of random effects specified in the sub-model to be extracted from the
jointmeta1
model fit.
1 |
fitted |
a |
type |
a character string indicating what level the random effects
covariance matrix should be returned for. If the individual level random
effects covariance matrix is required then |
a matrix of dimensions equal to the number of random effects at the
level specified by the type
parameter.
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 | #change example data to jointdata object
jointdat2<-tojointdata(longitudinal = simdat2$longitudinal,
survival = simdat2$survival, id = 'id',longoutcome = 'Y',
timevarying = c('time','ltime'),
survtime = 'survtime', cens = 'cens',time = 'time')
#set variables to factors
jointdat2$baseline$study <- as.factor(jointdat2$baseline$study)
jointdat2$baseline$treat <- as.factor(jointdat2$baseline$treat)
#fit multi-study joint model
#note: for demonstration purposes only - max.it restricted to 5
#model would need more iterations to truely converge
onestagefit<-jointmeta1(data = jointdat2, long.formula = Y ~ 1 + time +
+ treat + study, long.rand.ind = c('int', 'time'),
long.rand.stud = c('treat'),
sharingstrct = 'randprop',
surv.formula = Surv(survtime, cens) ~ treat,
study.name = 'study', strat = TRUE, max.it=5)
#extract the individual level random effects covariance matrix
rancov(onestagefit, type = "individual")
#extract the study level random effects covariance matrix
rancov(onestagefit, type = "study")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.