*! version 0.1.0 ?????2017

Title

merlin -- Extended multivariate generalised linear and non-linear mixed effects models

Syntax

merlin models ..., ...
model_description_options

model_description_options

family(), ... see merlin families

redistribution(redist_list) distribution of the random effects at each level

df(numlist) degrees of freedom for the t-distribution(s)

covariance() notation for treatment of covariances

weights(varlist) specify weights; see details

constraints() specify constraints

from() specify starting values

nogen do not generate the component and element variables; see details

Description

models and the options above describe the model to be fit by merlin.

Options

family() specifies the distribution, such as family(poisson). See
merlin family.

redistribution(redist_list)

gaussian specifies normally-distributed random effects

t specifies t-distributed random effects

For a 3-level model, we could specify a t distribution with df(5) at level 3, and normally distributed random effects
at level 2 by using redistribution(t gaussian) df(3).

df(numlist) specifies the degrees of freedom for the t-distributed random effects

covariance(struct_list) specifies the covariance structure for the random effects at each level. The structures of the
random effects should be defined in order from highest level to lowest. Available structures include

diagonal unique variances for each random effect, all covariances are 0; the default

identity all variances equal, all covariances are 0

unstructured all variances and covariances uniquely estimated

exchangeable all variances equal, all covariances equal

weights(varlist) specifies sample weights, applied multiplicatively to the likelihood at each level of the model. Multiple weight variables can be specified,
but must be entered in the order of lowest (observation-level) to highest. Those at level > 1 can be repeated within clusters,
but only a single value will be extracted, so they should be constant within clusters.

constraints() specifies parameter constraints you wish to impose on your
model.

from() specifies the starting values to be used in the optimization
process.

nogen stops merlin from generating Stata variables, representing those created in the component and element
specifications. By default, they are created and indexed by model, component and number.

Examples

For detailed examples, see reddooranalytics.se/products/merlin.

Setup

. use http://fmwww.bc.edu/repec/bocode/s/stjm_pbc_example_data, clear

Linear mixed effects model with unstructured variance-covariance structure

. merlin (logb time age trt time#M1[id]@1 M2[id]@1, family(gaussian)), covariance(unstructured)

Author

Michael J. Crowther

Red Door Analytics

Stockholm, Sweden

michael@reddooranalytics.se

References

Crowther MJ. Extended multivariate generalised linear and non-linear mixed effects models.
https://arxiv.org/abs/1710.02223

Crowther MJ. merlin - a unified framework for data analysis and methods development in Stata. Stata Journal 2020;20(4):763-784.

Crowther MJ. Multilevel mixed effects parametric survival analysis: Estimation, simulation and application. Stata Journal 2019;19(4):931-949.

Crowther MJ, Lambert PC. Parametric multi-state survival models: flexible modelling allowing transition-specific distributions with
application to estimating clinically useful measures of effect differences. Statistics in Medicine 2017;36(29):4719-4742.

Weibull CE, Lambert PC, Eloranta S, Andersson TM-L, Dickman PW, Crowther MJ. A multi-state model incorporating
estimation of excess hazards and multiple time scales. Statistics in Medicine 2021; (In Press).