Description Usage Arguments Value See Also Examples
View source: R/ranef.jointmeta1.R
This function extracts the estimated values of the random effects from a
supplied jointmeta1
fit.
1 2 |
object |
a |
type |
the type of random effects to return. Set |
... |
additional arguments; currently none are used. |
If type = 'individual'
then a list of matrices containing the
individual level random effects is returned. This list is of length equal
to the number of studies in the dataset. Each matrix has number of rows
equal to the number of individuals in the corresponding study, and number
of columns equal to the number of individual level random effects.
If type = 'study'
then if study level random effects are present in
the supplied model fit, a matrix of the estimated study level random
effects is returned, with number of rows equal to the number of studies in
the dataset, and number of columns equal to the number of study level
random effects. If study level random effects are requested but are not
present in the supplied model fit, an error message is returned.
jointmeta1
, jointmeta1.object
,
fixef
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
ranef(onestagefit, type = 'individual')
#extract the study level random effects covariance matrix
ranef(onestagefit, type = 'study')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.