fixef.jointmeta1: Extract fixed effects

Description Usage Arguments Value See Also Examples

View source: R/fixef.jointmeta1.R

Description

Function to extract the estimated fixed effects from a jointmeta1 model fit

Usage

1
2
## S3 method for class 'jointmeta1'
fixef(object, type = c("Longitudinal", "Survival", "Latent"), ...)

Arguments

object

A joint model fit from the function jointmeta1

type

Type of fixed effects to extract. To extract fixed effects from longitudinal sub-model set type = 'Longitudinal', from the time-to-event sub-model set type = 'Survival', or extract the latent association parameters set to type = 'Latent'.

...

additional arguments; currently none are used.

Value

The function returns a vector of the fixed effects from the specified part of the supplied jointmeta1 model fit.

See Also

jointmeta1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
   #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 2
   #model would need more iterations to truely converge
   onestagefit<-jointmeta1(data = jointdat2, long.formula = Y ~ 1 + time +
                           + treat + study, long.rand.ind = c('int'),
                           long.rand.stud = c('treat'),
                           sharingstrct = 'randprop',
                           surv.formula = Surv(survtime, cens) ~ treat,
                           study.name = 'study', strat = TRUE, max.it = 2)

    #extract longitudinal fixed effects
    fixef(onestagefit, type = 'Longitudinal')

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