How this calculation works
A shared frailty model gives members of one cluster a common unobserved multiplier on their event hazards. Individuals can then be dependent even after the measured covariates have been included.
Exponentialbaselinefirstmode:h_i(t|u_g)=u_g λexp(x_iβ),cumulativewithoutu H_i=λt_i exp(x_iβ);eventδ∈{0,1},clustersharedfrailtyu~Gamma(shape1/θ,scaleθ),mean1varθ. AggregateH_g=ΣH_i,d_g=Σδ. Integratedloglik_g=Σδlogh_i+Σ_{k=0}^{d_g-1}log(1+kθ)-(d_g+1/θ)log1p(θH_g). θ0limitordinaryindependentexponentiallikelihood. Posteriorfrailtymean=(1+θd)/(1+θH). Jointsurvival=(1+θH)^(-1/θ). Fitλ,β,θwithboundaryandmultipleclusters;use log1p/seriesnearθ0. Firstmode rightcensoronlywithindependentcensorassumption.A worked example
With the prefilled inputs, frailtyVariance = 0.5951040344485999. Rows [cluster,time,event0/1,covariates...]. Weibull baseline and shared gamma frailty.
Good to know
Weibull baseline with shared Gamma(mean1,varianceθ) cluster frailty analytically integrated. Local interior fit only; no θ=0 likelihood-ratio reference or automatic cluster-independent causal interpretation.
Reference: Primary method reference or author-maintained documentation (opens in a new tab) ↗
Represent shared event-time risk
A shared frailty model gives members of one cluster a common unobserved multiplier on their event hazards. Individuals can then be dependent even after the measured covariates have been included.
This is useful for repeated or related event-time observations when a shared latent risk is plausible. A cluster label alone does not prove the chosen multiplicative risk structure fits the data.
Compare with the Cox proportional hazards regression calculator with right censoring. Estimate cluster-level multiplicative hazard heterogeneity by integrating a gamma frailty; ordinary Cox assumes conditional independence without a shared latent hazard.
Use a mean-one gamma convention
Rows [cluster,time,event0/1,covariates...]. Weibull baseline and shared gamma frailty.The gamma frailty has mean one and variance theta. Fixing its mean separates the overall baseline hazard scale from the additional between-cluster variation.
A gamma distribution can be parameterized by rate or scale, so the convention must be explicit. Here shape is one divided by theta and scale is theta; swapping scale and rate would change the model. The baseline is Weibull rather than a fixed exponential model. Shape one is the exponential special case used in the arithmetic example; other shapes allow the baseline hazard to change with time. The interface estimates shape, scale, regression coefficients and a positive shared gamma variance from ten to sixty independent clusters. Covariate columns must vary independently of the intercept, because a constant column would be confounded with the baseline scale. The fitter checks this design condition instead of reporting arbitrary coefficients for an unidentified baseline shift.
Supply events and censored times
Each row contains a positive observed time, an event indicator and a cluster identifier. A censored observation contributes exposure time but no event-hazard factor.
The supported likelihood assumes the stated independent censoring mechanism. Left truncation, competing events and time-varying covariates need different risk contributions and should not be silently recoded into this simple input format.
Integrate at the cluster level
All rows in a cluster share one frailty, so their cumulative hazards and event counts combine before integration. Integrating every row separately would instead fit independent frailties and lose the intended dependence.
For the gamma distribution, that cluster integration has a closed form. Stable logarithmic expressions also preserve the zero-variance limit, where the frailty component disappears; the Weibull baseline remains, becoming exponential only when its shape is one.
A one-cluster likelihood check
Set the baseline rate and theta to one, with two times one and two and event indicators one and zero. The cluster cumulative hazard is three and the observed event count is one.
Its integrated likelihood is one-sixteenth, and the posterior mean frailty is one-half. The joint survival probability at those times without conditioning on the observed event pattern is one-quarter, a different quantity.
Distinguish conditional and marginal risk
A hazard conditional on frailty describes a cluster with a specified risk multiplier. After averaging over frailty, the marginal survival curve and hazard have a different shape.
Likewise, the posterior frailty mean uses the cluster's observed events and exposure. It is a model-based latent-risk summary, not a directly measured characteristic or a fixed personal risk prediction. A cluster with no observed events can still contribute substantial exposure information through its cumulative hazard.
Treat variance and privacy carefully
Several independent clusters are needed to estimate a shared-risk variance meaningfully. A boundary estimate of zero is possible, and ordinary interior-parameter uncertainty formulas may not apply there.
Event-time inputs can be sensitive when they concern health or identifiable people. Describe what the calculator actually processes and avoid entering identifying details into a mathematical demonstration. For cluster g, cumulative hazard sums the individual Weibull cumulative hazards multiplied by their covariate factors, while observed event indicators contribute to the cluster's event count. Gamma integration then produces one cluster likelihood term. Posterior mean frailty combines that event count with cumulative exposure; it is not an observed group characteristic. The numerical search returns an interior positive-variance local candidate with a score diagnostic. It does not compare an exact zero-variance boundary model or provide a variance significance test. Independent censoring, fixed covariates and the shared-frailty structure remain statistical assumptions rather than conclusions from a converged optimizer. Weibull baseline with shared Gamma(mean1,varianceθ) cluster frailty analytically integrated. Local interior fit only; no θ=0 likelihood-ratio reference or automatic cluster-independent causal interpretation.
A few questions, answered
Why must frailty have mean one?
It separates the shared-risk variation from the baseline hazard scale and identifies the parameterization.
Can I integrate each observation separately?
Not for shared frailty; all members of a cluster must be combined before the common frailty is integrated out.
Does censoring count as an event?
No. It contributes time at risk and survival information, with an event indicator of zero.
What happens when theta is zero?
The frailty becomes a constant one and the model reduces to the stated no-frailty baseline regression.