*! version 1.0.0 05sep2019
help stpreg

Title

stpreg -- Probability of Occurrence of Events Models

Syntax

stpreg [indepvars] [if] [in]
[, options]

options

Model
df(#) apply a restricted cubic spline transformation (RCS) with # degrees of freedom either to log time or to time

noorthog turns off the default orthogonalisation of the splines

time create splines using time rather than log time, the default

tvc(varlist) time-varying covariates

tvcdf(#) degrees of freedom for the time-varying interaction terms; default is df(#)

timefunction(string) user defined function of time

Maximization options
nodes(#) number of quadrature nodes; default is 15

search(string) search option to pass to ml

initmat(matrix_name) matrix of initial values to pass to ml

copy parameters in the initial values matrix are entered by position

skip skip any parameters found in initial values matrix but not in model

Reporting
rr report risk ratios instead of odds ratios

rd report risk differences instead of odds ratios (default)

power report power instead of odds ratios (default)

coef report estimated coefficients instead of the exponentiated form. If the option rd is defined, coef is automatically specified

showcomponent display the components in each equation of the model

level(#) set confidence level; default is level(95)

nolog suppress display of log-likelihood iteration log

mataloghazard display the log hazard function passed to Mata

matakeep do not drop data from Mata after fitting a model

See [R] stpreg postestimation for features
available after estimation.

Description

stpreg can estimate event-probabilities models which properly defines the instantaneous probability of an event.
The command stpreg is based on Stata command [R] stgenreg developed by Michael J. Crowtherand and Paul C. Lambert.

Options for stpreg

Model

df(#) creates restricted cubic splines of either log time or time. df(#) defines the number of degrees of freedom.

noorthog turns off the default orthogonalisation of the restricted cubic splines.

time specifies that splines are created using time rather than log time, the default.

tvc(varlist) specifies those variables that vary continuously with respect to time, that is, time-varying covariates. tvc() requires df(), however, if both tvc() and gfunctions() are defined, df() is no longer needed.

tvcdf(#) defrees of freedom for the spline of time included in the interaxtion with the time-varyng covariates; default is df(#). If tvc() is not defined, option tvcdf() is disregarded.

timefunction defines the time function. timefunction() is any user defined function of #t written in Mata code, for example #t:^2.

Maximization options

nodes(#) defines the number of Gauss-Legendre quadrature points used to evaluate the cumulative hazard function in the maximisation process. Must be an integer > 2, with default 15.

search(string) search option to pass to ml.

initmat(matrix_name) passes a matrix of initial values.

copy pass initial values by position rather than name.

skip any parameters found in the initial values matrix but not in model are skipped.

maximize_options; difficult, technique(algorithm_spec), iterate(#), [no]log, trace, gradient, showstep, hessian, shownrtolerance, tolerance(#), ltolerance(#), gtolerance(#), nrtolerance(#), nonrtolerance, from(init_specs); see [R] maximize. These options are seldom used, but the difficult option may be useful if there are convergence problems.

Reporting

rd reports the risk differences instead of the log-odds ratios.
Note that option eform can not be specified with rd.
This model is less stable than the other models.

rr reports the log risk ratios instead of the log-odds ratios.
This model is less stable than the log-odds or log-power models.
The model becomes more stable by specifing option difficult or by
increasing the number of quadrature nodes.

power reports the log power-probabilities instead of the log-odds.

coef report estimated coefficients instead of the exponentiated form. If the option rd is defined, coef is automatically specified.

showcomponent displays each parsed component specified in the eq_name options. This is useful to check that the options have been parsed correctly.

level(#) specifies the confidence level for confidence intervals. The default is level(95) or as set by set level. See
[R] estimation options

nolog suppresses showing the iteration log of the progress of the log likelihood.

mataloghazard displays the log hazard function passed to Mata. This is useful to check that the log hazard function of the model.

matakeep does not drop the data from Mata following a model fit. By default, all data passed to Mata are dropped.

Examples

webuse brcancer

stset rectime, failure(censrec = 1) scale(365.25)

Proportional log odds-model

stpreg hormon

Proportional risk-difference model

stpreg hormon, rd

Proportional risk-ratio model

stpreg hormon, rr eform

Odds-model with spline time and time-varying covariate

stpreg hormon, eform df(3) tvc(hormon)

Odds-model with spline time and time-varying covariate

stpreg hormon, eform df(3) tvc(hormon) tvcdf(1)

Odds-model with timefunction() function of time and time-varying covariate

stpreg hormon, eform timefunction(#t:^2) tvc(hormon)

Proportional power-model equivalent to a Cox regression

stpreg hormon, power df(3) eform nolog

stcox hormon

References

Bottai M, Discacciati A, Santoni G (2019). Modeling the probability of occurrence of events. Submitted.

Bottai, M. (2017). A regression method for modelling geometric rates. Statistical Methods in Medical Research 26(6), 2700-2707.

Discacciati, A. and M. Bottai (2017). Instantaneous geometric rates via generalized linear models. Stata Journal 17(2), 358-371.

Authors

Matteo Bottai

Unit of Biostatistics

Institute of Environmental Medicine, Karolinska Institutet

Stockholm, Sweden

Andrea Discacciati

Department of Medical Epidemiology and Biostatistics, Karolinska Institutet

Stockholm, Sweden

Giola Santoni

Upper Gastrointestinal Unit

Department of Molecular Medicine and Surgery, Karolinska Institutet

Stockholm, Sweden

Acknowledgement

The stpreg command was developed from the stgenreg command.

Crowther, M. and Lambert, P. (2013). stgenreg: A stata package for general parametric
survival analysis. Journal of Statistical Software 53, 1-17.

Also see

Online: [R] st, [R] stgenreg