| Type: | Package |
| Title: | Simultaneous-Equations Hazard/Probit Models with a Gaussian-Copula Correlation |
| Version: | 1.0.0 |
| Date: | 2026-09-25 |
| Description: | Fits two-equation simultaneous models in the style of Lillard (1993) <doi:10.1016/0304-4076(93)90106-F>: a pair of processes, each either a binary probit outcome or a continuous-time hazard duration, linked through a single correlation parameter between their underlying error terms and estimated jointly by maximum likelihood via a Gaussian copula. Equation 1 may be a probit, a log-normal accelerated-failure-time hazard, or a piecewise (linear-log-hazard) Gompertz hazard with an arbitrary, user-specified number of segments; equation 2 is always a hazard, log-normal or piecewise Gompertz. Models can also be fit under independence (correlation fixed at zero), which reduces exactly to two separate univariate fits. See the package vignette/manual for the full likelihood derivation and a simulation-based verification. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Depends: | R (≥ 3.5) |
| Imports: | maxLik, pbivnorm, stats |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| URL: | https://github.com/nobifukuda/lillardhaz |
| BugReports: | https://github.com/nobifukuda/lillardhaz/issues |
| Config/roxygen2/version: | 8.0.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-10-06 09:08:06 UTC; nfukuda |
| Author: | Nobutaka Fukuda [aut, cre] |
| Maintainer: | Nobutaka Fukuda <nobutaka.fukuda@tohoku.ac.jp> |
| Repository: | CRAN |
| Date/Publication: | 2026-10-16 09:20:13 UTC |
lillardhaz: Simultaneous-Equations Hazard/Probit Models
Description
Fits two-equation simultaneous models in the style of Lillard (1993): a
pair of processes – each a binary probit outcome or a continuous-time
hazard duration – linked through a single correlation parameter between
their underlying error terms, estimated jointly by maximum likelihood via
a Gaussian copula. See fit_lillardhaz.
Author(s)
Maintainer: Nobutaka Fukuda nobutaka.fukuda@tohoku.ac.jp
Authors:
Nobutaka Fukuda nobutaka.fukuda@tohoku.ac.jp
See Also
Useful links:
Report bugs at https://github.com/nobifukuda/lillardhaz/issues
Fit a Lillard-style simultaneous-equations hazard/probit model
Description
Fits a two-equation simultaneous model in the style of Lillard (1993): a pair of processes, each either a binary probit outcome or a continuous- time hazard duration, linked through a single correlation parameter between their underlying error terms and estimated jointly by maximum likelihood via a Gaussian copula.
Usage
fit_lillardhaz(
eq1,
eq2,
data,
y1,
d1 = NULL,
y2,
d2,
x1 = character(0),
x2 = character(0),
nodes1 = NULL,
nodes2 = NULL,
corr = TRUE,
start = NULL,
method = "BFGS"
)
Arguments
eq1 |
one of |
eq2 |
one of |
data |
a data frame. |
y1 |
name of equation 1's outcome: the binary 0/1 variable if
|
d1 |
name of equation 1's failure indicator (ignored if
|
y2 |
name of equation 2's duration variable. |
d2 |
name of equation 2's failure indicator. |
x1 |
character vector of covariate names for equation 1's location index (may be empty for an intercept-only equation). |
x2 |
character vector of covariate names for equation 2's location index. |
nodes1, nodes2 |
interior nodes (ascending numeric vectors) for a
piecewise-Gompertz equation 1/equation 2; required exactly when that
equation is |
corr |
logical; if |
start |
optional named numeric vector of starting values. |
method |
optimization method passed to |
Value
An object of class "lillardhaz": a list with components
coefficientsnamed numeric vector of maximum-likelihood estimates (equation 1 and 2 location coefficients, ancillary parameters such as
ln_sigmaor piecewise-Gompertz slopes, andatanh_rhoifcorr = TRUE).sestandard errors from the inverse negative Hessian (
NAif the Hessian is singular).loglikmaximized log-likelihood.
rho,rho_seestimated copula correlation between the two equations' error terms and its delta-method standard error (
0andNAwhencorr = FALSE).fitthe underlying
maxLikobject.eq1type,eq2type,nodes1,nodes2,corr,x1,x2,y1name,y2namethe model specification.
nnumber of observations.
callthe matched call.
Methods for print, summary and predict are
available.
Examples
set.seed(1)
n <- 2000
x1 <- rnorm(n); x2 <- rbinom(n, 1, 0.5)
t1 <- exp(1 - 0.3 * x1 + 0.5 * rnorm(n))
c1 <- -log(runif(n)) / 0.05
t2 <- exp(0.6 + 0.4 * x2 + 0.6 * rnorm(n))
c2 <- -log(runif(n)) / 0.05
d <- data.frame(
time1 = pmin(t1, c1), event1 = as.integer(t1 <= c1),
time2 = pmin(t2, c2), event2 = as.integer(t2 <= c2),
x1 = x1, x2 = x2
)
fit <- fit_lillardhaz("lognormal", "lognormal", d,
y1 = "time1", d1 = "event1", y2 = "time2", d2 = "event2",
x1 = "x1", x2 = "x2")
summary(fit)
head(predict(fit, type = "surv2"))
Predicted survival/density/index from a fitted lillardhaz model
Description
Predicted survival/density/index from a fitted lillardhaz model
Usage
## S3 method for class 'lillardhaz'
predict(object, newdata, type = "surv2", ...)
Arguments
object |
a fitted |
newdata |
optional data frame; defaults to the estimation sample via
|
type |
one of |
... |
unused. |
Value
A numeric vector with one element per row of newdata,
evaluated at the estimated coefficients. Its meaning depends on
type:
"xb1","xb2"the linear location index
x'\betaof equation 1 or 2 (for a log-normal equation, the mean of log duration; for a piecewise-Gompertz equation, the log of the proportional hazard shift)."pr1"the predicted probability that the binary outcome of equation 1 equals 1,
\Phi(x'\beta); only available wheneq1 = "probit"."surv1","surv2"the marginal survival probability
S(t), a value in [0, 1], of equation 1 or 2 evaluated at the observed duration innewdata(variabley1ory2used in the fit)."dens1","dens2"the marginal density
f(t)of equation 1 or 2 evaluated at that duration.
The survival and density predictions are marginal (per equation) and do not condition on the other equation's outcome.