Skip to main content

Survival, Bayesian, Meta-Analysis & Resampling

Statistical methods for survival analysis, Bayesian inference, meta-analytic pooling, and resampling-based inference. Includes Kaplan-Meier curves, Cox proportional-hazards regression, parametric and competing-risks models, Bayesian linear/logistic/hierarchical regression with MCMC diagnostics, fixed- and random-effects meta-analysis, and bootstrap/jackknife/permutation methods.

68 procedures · 3 with documented limitations. Every result is computed by the open Python engine and is exportable to APA tables and reports.

ProcedureWhat it doesStatusKey reference
Kaplan-Meier Survival CurvesNon-parametric survival estimation with Greenwood pointwise 95% CI and log-rank/multivariate log-rank test.✅ FullKaplan & Meier (1958); Greenwood (1926)
Cox Proportional HazardsSemi-parametric hazard regression with Efron tie handling, PH assumption test (Grambsch-Therneau), and concordance index.✅ FullCox (1972); Efron (1977)
Mixture Cure ModelFits a Berkson-Gage mixture cure model by EM, separating a logistic incidence submodel for the long-term-survivor (cured) fraction from a Weibull AFT latency submodel for the susceptible subjects who can still experience the event.✅ FullBerkson & Gage (1952); Sy & Taylor (2000)
Piecewise-Exponential SurvivalProportional-hazards survival model with a piecewise-constant baseline hazard, fitted by the Poisson / piecewise-exponential equivalence on person-interval exposure with covariate log-hazard-ratios; reduces to the exponential model with one interval.✅ FullFriedman (1982); Holford (1980)
Discrete-Time Hazard (cloglog)Fits a discrete-time (grouped-duration) proportional-hazards model by expanding subjects into person-period rows and estimating a complementary-log-log binomial GLM, yielding constant-across-time log-hazard-ratios that mirror the Cox model at low per-period hazard, plus a nonparametric or polynomial baseline-hazard summary.✅ FullPrentice & Gloeckler (1978); Allison (1982)
Actuarial Life TableCutler-Ederer life table with conditional survival/death probabilities, cumulative hazard rate, and Greenwood SE.✅ FullKalbfleisch & Prentice (2002); Greenwood (1926)
Parametric Survival ModelsUnivariate or AFT parametric models (Weibull, exponential, lognormal, log-logistic, Gompertz) with parameter estimates.✅ FullKalbfleisch & Prentice (2002); Akaike (1974)
Accelerated Failure TimeAFT regression with covariates, time ratio estimates, concordance index, and AIC.✅ FullKalbfleisch & Prentice (2002); Akaike (1974)
Competing Risks (Fine-Gray)Subdistribution-hazards model with cumulative incidence functions per event type and subdistribution HR.✅ FullFine & Gray (1999); Aalen & Johansen (1978)
Shared Frailty Cox ModelCluster-robust Cox with gamma frailty variance estimate and LR test vs no-frailty baseline.⚠️ LimitedVaupel et al. (1979); Therneau & Grambsch (2000)
Schoenfeld Residuals TestPH assumption test per covariate and globally using scaled Schoenfeld residuals with interpretation.✅ FullCox (1972); Schoenfeld (1982)
Nelson-Aalen Cumulative HazardNon-parametric cumulative hazard estimator with 95% pointwise confidence bands, optionally grouped.✅ FullNelson (1972); Aalen (1978)
Stratified Log-Rank TestLog-rank test with optional stratification, multivariate for 3+ groups, and pairwise comparisons.✅ FullMantel (1966); Mantel & Haenszel (1959)
Restricted Mean Survival TimeRMST up to user-specified tau with SE and 95% CI; difference test and CI for 2 groups.✅ FullRoyston & Parmar (2013); Uno et al. (2014)
Time-Varying Cox ModelCox regression with time-varying covariates (start-stop format), HR with CI and partial log-likelihood.✅ FullCox (1972); Andersen & Gill (1982)
Cox Residuals for DiagnosticsFive residual types (martingale, deviance, Schoenfeld, scaled Schoenfeld, score) for model diagnostics.✅ FullCox (1972); Therneau et al. (1990)
Bayesian Linear RegressionMCMC-based (PyMC or emcee fallback) with weakly informative priors, posterior samples, PPC, and diagnostics (R-hat, ESS).✅ FullGelman et al. (2013); Goodman & Weare (2010)
Bayesian Unit-Root AnalysisClosed-form Student-t posterior for the AR(1) root rho under a flat/Jeffreys prior, reporting the posterior mean/sd, a 95% credible interval, and the posterior probabilities P(rho>=1) (unit root/explosive) and P(rho<1) (stationary).✅ FullSims (1988); Sims & Uhlig (1991)
Bayesian VAR (Minnesota prior)Estimates a reduced-form VAR(p) with the Minnesota (Litterman) shrinkage prior imposed by dummy observations, reporting posterior-mean coefficient matrices that center the own first lag at 1 (levels) or 0 (stationary), shrink cross-variable lags harder than own lags by 1/lag, plus the shrinkage hyperparameters, per-equation in-sample fit, and a multi-step forecast.✅ FullLitterman (1986); Doan, Litterman & Sims (1984)
Bayesian VECM (cointegration)Bayesian Vector Error Correction Model for cointegrated series: given a chosen cointegrating rank and lag order, places a weakly-informative Normal-inverse-Wishart prior on the short-run dynamics and adjustment coefficients and Gibbs-samples the posterior, reporting posterior means and 95% credible intervals for the speed-of-adjustment loadings (alpha), the normalised cointegrating vectors (beta), the short-run matrices, and error-correction evidence.✅ FullKoop, Strachan, van Dijk & Villani (2006); Sugita (2009)
Bayesian CFA (one-factor)Fits a one-factor confirmatory measurement model x_ij = lambda_j * eta_i + eps_ij by a three-block Gibbs sampler (factor scores, loadings, residual variances), returning posterior loading summaries with 95% credible intervals, residual (uniqueness) variances, implied communalities, and an SRMR-based fit summary.✅ FullLee (2007)
Bayesian IRT (2PL)Bayesian two-parameter logistic item-response model fitted by a Metropolis-within-Gibbs MCMC sampler, returning posterior item discriminations and difficulties (with 95% credible intervals) plus latent person-ability summaries on the N(0,1)-identified scale.✅ FullAlbert (1992); Fox (2010)
Bayesian Meta-AnalysisFits a random-effects meta-analysis (theta_i ~ N(mu, tau^2), y_i ~ N(theta_i, se_i^2)) by a direct Gibbs sampler with a weakly-informative half-Cauchy prior on the between-study sd, returning the posterior overall effect mu with credible interval, between-study heterogeneity tau, shrunken per-study estimates, and the posterior probability the effect is positive.✅ FullDuMouchel (1990); Smith, Spiegelhalter & Thomas (1995)
Conjugate Bayesian Regression (Normal-Gamma)Analytic conjugate Bayesian linear regression with a Normal-Gamma (Normal-inverse-Gamma) prior that returns closed-form multivariate-t posteriors for the coefficients and an inverse-Gamma posterior for the error variance, reducing exactly to OLS under a flat prior and shrinking slopes toward zero under a tight prior, with no MCMC.✅ FullLindley & Smith (1972); Koop (2003)
Bayesian Quantile RegressionEstimates the conditional tau-quantile of an outcome via the asymmetric-Laplace likelihood, sampling the posterior of the quantile-regression coefficients with the Kozumi-Kobayashi (2011) location-scale-mixture Gibbs sampler and reporting posterior means, sds and 95% credible intervals.✅ FullYu & Moyeed (2001); Kozumi & Kobayashi (2011)
Student-t (robust) RegressionOutlier-robust linear regression with iid Student-t(nu) errors fitted by an EM / IRLS scale-mixture ML algorithm, downweighting extreme residuals so the fit tracks the bulk of the data rather than the outliers, and reporting coefficients/SEs, the error scale, the (optionally ML-estimated) degrees of freedom, log-likelihood and per-observation robustness weights.✅ FullLange, Little & Taylor (1989, JASA); Geweke (1993)
Metropolis-Hastings (Bayesian regression)Random-walk Metropolis-Hastings MCMC sampler for the joint posterior of regression coefficients and the error variance (beta, log sigma^2) in Bayesian linear regression, with a proposal auto-tuned toward the optimal ~0.234 acceptance rate, reporting posterior means/sds/95% credible intervals, the acceptance rate, and effective sample sizes.✅ FullMetropolis et al. (1953); Hastings (1970)
Gibbs Sampler (Bayesian regression)Conjugate Gibbs sampler for Bayesian linear regression that alternates Normal draws of the coefficients given sigma^2 and inverse-Gamma draws of sigma^2 given the coefficients, returning posterior means/sds/95% credible intervals, effective sample size and a Geweke convergence diagnostic (acceptance is identically 1), with weak-prior posteriors that coincide with OLS.✅ FullGelfand & Smith (1990, JASA); Geman & Geman (1984)
Laplace Approximation (Bayesian)Approximates the posterior of a Bayesian linear or logistic regression by a Gaussian centered at the posterior mode (MAP) with inverse-Hessian covariance, reporting approximate posterior means/SDs/credible intervals, the Laplace approximation to the log marginal likelihood (model evidence), and a Tierney-Kadane fully-exponential refined posterior mean.✅ FullTierney & Kadane (1986, JASA); Rue, Martino & Chopin (2009, JRSS-B)
Importance Sampling (Bayesian)Bayesian posterior inference for a linear regression by importance sampling / sampling-importance-resampling: proposals drawn from a heavy-tailed multivariate-t centred at OLS (covariance inflated) under a weakly-informative conjugate Normal-inverse-Gamma prior are reweighted to give importance-weighted posterior means, 95% credible intervals for the coefficients and error variance, the weights' effective sample size, and a resampled (SIR) posterior draw.✅ FullGeweke (1989); Rubin (1987)
Bayesian Poisson RegressionFits a log-linear Poisson count model by random-walk Metropolis-Hastings under a weak Normal prior, returning posterior means, standard deviations and 95% credible intervals for each coefficient, the incidence-rate ratios exp(coef), and the Metropolis acceptance rate (tuned toward the ~0.234 optimal scaling).✅ FullGelman et al. (2013, BDA 3rd ed.)
Bayesian TobitLeft-censored (Tobit) regression estimated by Gibbs sampling with data augmentation of the censored latent responses, returning posterior means and 95% credible intervals for the coefficients and error standard deviation plus the censored fraction.✅ FullChib (1992)
Bayesian Probit (Albert-Chib)Fits a binary probit model by Gibbs sampling with Albert-Chib truncated-normal latent-utility data augmentation under a diffuse Normal prior, returning posterior means, SDs, 95% credible intervals, effective sample sizes, and the frequentist MLE as a reference.✅ FullAlbert & Chib (1993, JASA)
Horseshoe Regression (sparse)Bayesian linear regression with a horseshoe shrinkage prior (Carvalho-Polson-Scott 2010) sampled by the fully-conjugate Makalic-Schmidt (2016) inverse-gamma scale-mixture Gibbs sampler, reporting posterior means and 95% credible intervals per coefficient, per-coefficient shrinkage weights kappa = 1/(1 + ntau^2lambda^2), and which coefficients are effectively selected (CI excludes 0) so that on sparse designs the null coefficients are shrunk hard toward 0 while genuine signals stay near their true values.✅ FullCarvalho, Polson & Scott (2010, Biometrika); Makalic & Schmidt (2016, IEEE SPL)
Spike-and-Slab Variable SelectionBayesian stochastic search variable selection (George-McCulloch SSVS) that places a two-component spike-at-zero / diffuse-slab prior on every regression coefficient and Gibbs-samples Bernoulli inclusion indicators to report each predictor's posterior inclusion probability (PIP), Bayesian-model-averaged coefficients, and the most probable visited models.✅ FullGeorge & McCulloch (1993, JASA); Mitchell & Beauchamp (1988)
Bayesian LassoBayesian lasso regression (Park & Casella) places a Laplace prior on the coefficients and samples it with a scale-mixture-of-normals Gibbs sampler, returning shrunk posterior-mean coefficients with 95% credible intervals, the posterior of the shrinkage parameter lambda, and which predictors are effectively selected (CI excludes 0).✅ FullPark & Casella (2008, JASA)
Adaptive LassoWeighted lasso (Zou 2006) whose per-coefficient penalties come from an initial OLS/ridge estimate, delivering oracle variable selection: truly-zero coefficients are driven to exactly 0 while genuine signals stay nearly unbiased, with the penalty chosen by reproducible cross-validation.✅ FullZou (2006, JASA)
Savage-Dickey Bayes FactorComputes the Savage-Dickey density-ratio Bayes factor (BF01/BF10) for the sharp null H0: beta=0 on one regression coefficient by taking the ratio of the marginal posterior to the prior density at zero under a conjugate Normal-prior Bayesian regression, returning posterior mean/sd, the prior sd, and a Jeffreys-scale verdict.✅ FullDickey (1971); Verdinelli & Wasserman (1995)
Bayesian IC (DIC/WAIC/LOO)Bayesian predictive information criteria for a conjugate-Gibbs Bayesian linear regression, reporting DIC (Spiegelhalter), WAIC (Watanabe) and Pareto-smoothed importance-sampling LOO (Vehtari-Gelman-Gabry) on the deviance scale with their effective-parameter counts (p_DIC, p_WAIC, p_LOO) and Pareto-k diagnostics, for principled out-of-sample model comparison.✅ FullSpiegelhalter et al. (2002); Watanabe (2010); Vehtari, Gelman & Gabry (2017)
Bayesian Model AveragingEnumerates all 2^k linear-regression covariate subsets, scores each by BIC to obtain approximate posterior model probabilities, and reports per-predictor posterior inclusion probabilities (PIP), BMA posterior means/sds of the coefficients (averaged over models), and the top models.✅ FullRaftery, Madigan & Hoeting (1997); Hoeting et al. (1999)
Bayesian Logistic RegressionBernoulli likelihood with logit link, posterior odds ratios, in-sample accuracy, and MCMC diagnostics.✅ FullGelman et al. (2013); Goodman & Weare (2010)
Bayesian Hierarchical ModelRandom-intercept multilevel model (PyMC, emcee, or OLS shrinkage fallback) with ICC, varying intercepts per group.⚠️ LimitedGelman et al. (2013); Goodman & Weare (2010)
MCMC DiagnosticsGelman-Rubin R-hat, ESS via autocorrelation, trace summaries with interpretations of convergence.✅ FullGelman & Rubin (1992); Gelman et al. (2013)
Bayes FactorModel comparison via BIC approximation with Jeffreys-scale interpretation (decisive/strong/moderate/anecdotal).⚠️ LimitedKass & Raftery (1995); Jeffreys (1961)
Prior vs PosteriorVisualization comparison of prior and posterior distributions per parameter.✅ FullGelman et al. (2013); Goodman & Weare (2010)
Posterior Predictive CheckBayesian p-value and visual comparison of observed vs simulated data from posterior predictive.✅ FullGelman et al. (1996); Gelman et al. (2013)
Credible IntervalHighest density interval (HDI) and equal-tailed interval (ETI) at 94% credibility.✅ FullKruschke (2015)
Fixed-Effects Meta-AnalysisInverse-variance weighting, Cochran Q, I², per-study and pooled CIs, assumes homogeneous effects.✅ FullHedges & Olkin (1985); Cochran (1954)
Random-Effects Meta-AnalysisDerSimonian-Laird tau² estimation, I², 95% prediction interval (Higgins-Thompson-Spiegelhalter), per-group weights.✅ FullDerSimonian & Laird (1986); Cochran (1954)
Egger's Test for Publication BiasFunnel-plot asymmetry test via standardized-effect intercept regression, t-test on k-2 df.✅ FullEgger et al. (1997)
Forest Plot DataPer-study effects with 95% CI, pooled estimate (fixed or random), I², and heterogeneity for visualization.✅ FullLewis & Clarke (2001); DerSimonian & Laird (1986)
Bootstrap Standard ErrorBootstrap distribution of a statistic (mean/median/std/var/quantiles) with SE, bias, and summary.✅ FullEfron (1979)
Wild Bootstrap (OLS)Wild (and wild-cluster) bootstrap standard errors, percentile CIs, and p-values for OLS coefficients, robust to heteroskedasticity and the standard tool for few-cluster inference.✅ FullWu (1986); Cameron, Gelbach & Miller (2008)
Percentile-t Bootstrap (coefficient)Studentized (bootstrap-t) confidence interval for a single OLS regression coefficient, built by pairs-resampling the pivot t*=(b*-b)/se* and inverting it via the Hall pivot-flip formula for second-order-accurate, skewness-corrected coverage, contrasted against the normal-theory b +/- 1.96 se interval.✅ FullHall (1992); Davison & Hinkley (1997)
Block Bootstrap (time series)Moving-block and circular-block bootstrap that resamples overlapping blocks of consecutive observations to deliver dependence-robust standard errors and percentile confidence intervals for the mean, median, variance, or lag-1 autocorrelation of a time series.✅ FullKunsch (1989); Politis & Romano (1992)
Parametric Bootstrap (OLS)Resamples OLS errors from the fitted homoskedastic-Gaussian model (y* = X*beta_hat + N(0, sigma^2)), refits each synthetic sample, and reports per-coefficient bootstrap SEs and percentile 95% CIs that converge to the classical OLS standard errors as replications grow.✅ FullEfron & Tibshirani (1993)
Residual Bootstrap (OLS)Model-based (residual) bootstrap that holds the design and fitted values fixed, resamples OLS residuals with replacement to build synthetic responses, refits each, and reports per-coefficient bootstrap standard errors and percentile 95% confidence intervals without assuming any error distribution.✅ FullEfron (1979); Freedman (1981)
Subsampling InferencePolitis-Romano-Wolf subsampling: draws subsamples of size b < n without replacement, recomputes a statistic on each, and uses the sqrt(b)-rescaled subsampling distribution to build a confidence interval and standard error that are stable as b varies.✅ FullPolitis & Romano (1994); Politis, Romano & Wolf (1999)
Bayesian Bootstrap (Rubin)Rubin's Bayesian bootstrap for OLS coefficients: draws Dirichlet(1,...,1) weights over the observations and refits weighted least squares each replication to produce a posterior distribution (mean, sd, 95% credible interval) for every coefficient, first-order equivalent to the ordinary bootstrap.✅ FullRubin (1981, Ann. Statist.)
BCa Bootstrap IntervalBias-corrected and accelerated (BCa) bootstrap 95% confidence interval for a chosen scalar statistic (mean, median, std, variance, quartiles, IQR) of one numeric variable, correcting the plain percentile interval for median bias (z0) and skewness (jackknife acceleration a).✅ FullEfron (1987, JASA); Efron & Tibshirani (1993)
Cluster Bootstrap (OLS)Pairs cluster bootstrap for OLS coefficient inference that resamples whole clusters with replacement and refits to produce cluster-robust bootstrap standard errors and percentile confidence intervals valid under arbitrary within-cluster error correlation.✅ FullCameron, Gelbach & Miller (2008)
Bootstrap Confidence IntervalFour CI methods (percentile, basic, BCa, studentized) with distribution summary and downsampled samples.✅ FullEfron (1979); Efron (1987)
Bootstrap RegressionRow-level resampling with OLS per iteration; bootstrap SE, bias, CI, and comparison to classical estimates.✅ FullEfron (1979)
Jackknife EstimationLeave-one-out resampling, SE, bias correction, and bias-corrected estimate.✅ FullEfron (1979); Quenouille (1956)
Permutation Test (Two-Sample)Exact resampling test for mean/median/t-stat difference with null distribution and two-tailed p-value.✅ FullEfron (1979); Fisher (1935)
Permutation Test (Correlation)Exact test for Pearson/Spearman/Kendall correlation with null distribution and significance.✅ FullEfron (1979); Fisher (1935)
Cross-ValidationK-fold CV (sklearn-compatible) for linear/logistic/ridge/lasso with multiple scoring metrics.✅ FullEfron (1979); Stone (1974)
Bayesian BootstrapDirichlet-weighted resampling for posterior distribution of a statistic; Bayesian alternative to classical bootstrap.✅ FullEfron (1979); Rubin (1981)

Notes & limitations

  • Shared Frailty Cox Model — Gamma frailty only; variance estimated via martingale residuals.
  • Bayesian Hierarchical Model — Fallback uses OLS-shrinkage approximation without full MCMC; ICC computed from variance components.
  • Bayes Factor — BIC-based approximation; not exact marginal likelihood.