Description
Usage
Arguments
Author(s)
References
See Also
Examples
View source: R/merlin_predict.R
predictions following the fit of a merlin model
 ## S3 method for class 'merlin'
(object, stat = "eta", = "fixedonly",
predmodel = 1, causes = , )

object 
merlin model object

stat 
specifies which prediction, which can be one of:

eta the expected value of the complex predictor

mu the expected value of the response variable

hazard the hazard function

chazard the cumulative hazard function

logchazard the log cumulative hazard function

survival the survival function

cif the cumulative incidence function

rmst calculates the restricted mean survival time, which is the integral of the
survival function within the interval (0,t], where t is the time at which predictions are made.
If multiple survival models have been specified in your merlin model, then it will assume all
of them are causespecific competing risks models, and include them in the calculation. If
this is not the case, you can override which models are included by using the causes
option. rmst = t  totaltimelost .

timelost calculates the time lost due to a particular event occurring, within
the interval (0,t]. In a single event survival model, this is the integral of the cif between
(0,t]. If multiple survival models are specified in the merlin model then by default all are
assumed to be causespecific event time models contributing to the calculation. This can be
overridden using the causes option.

totaltimelost total time lost due to all competing events, within (0,t]. If multiple
survival models are specified in the merlin model then by default all are assumed to
be causespecific event time models contributing to the calculation. This can be overridden
using the causes option. totaltimelost is the sum of the timelost due to
all causes.

type 
the type of prediction, either:

fixedonly prediction calculated based only on the fixed effects; the default.

marginal prediction calculated marginally with respect to the latent variables. the
stat is calculated by integrating the prediction function with respect to all the latent
variables over their entire support.

predmodel 
specifies which model to obtain predictions from; default is predmodel=1

causes 
is for use when calculating predictions from a competing risks merlin model.
By default, cif , rmst , timelost and totaltimelost assume that all
survival models included in the merlin model are causespecific hazard models contributing to
the calculation. If this is not the case, then you can specify which models (indexed using
the order they appear in your merlin model by using the causes option, e.g.
causes=c(1,2) .

... 
other options

Emma C. Martin, Alessandro Gasparini and Michael J. Crowther
Crowther MJ. Extended multivariate generalised linear and nonlinear mixed
effects models. https://arxiv.org/abs/1710.02223
Crowther MJ. merlin  a unified framework for data analysis and methods development
in Stata. https://arxiv.org/abs/1806.01615
Martin EC, Gasparini A, Crowther MJ. merlin  an R package for mixed effects
regression of linear, nonlinear and userdefined models.
merlin
 ()
(, package = "merlin")
# Linear fixedeffects model
mod <(model = ( ~ year),
= "gaussian",
= )
(mod,stat="eta",="fixedonly")

merlin documentation built on Aug. 16, 2018, 5:04 p.m.