Time-Varying Covariates in Survival Models

Research Depth 189 in the knowledge graph I know this Set as goal
Unlocks 1 downstream topic
time-varying extended-Cox counting-process landmark-analysis

Core Idea

Time-varying covariates are variables whose values change during follow-up — blood pressure readings, biomarker levels, treatment switches, or disease progression markers. The standard Cox model assumes covariates are fixed at baseline, but extending it to time-varying covariates uses the counting process formulation, where each subject contributes multiple intervals of observation with updated covariate values. The hazard at any moment depends on the current covariate value at that moment: h(t|X(t)) = h_0(t) × exp(beta × X(t)). This extension raises the critical issue of immortal time bias when the time-varying covariate is defined by a future event (e.g., receiving a transplant), and requires careful distinction between external covariates (determined outside the failure process) and internal covariates (generated by the subject, potentially informative about prognosis).

Explainer

The standard Cox model treats all covariates as measured once at baseline and fixed throughout follow-up. But many clinically important variables change over time: a patient's blood pressure is monitored repeatedly, treatment may be switched, biomarkers rise and fall. Ignoring these changes means the model uses stale information — a patient whose cholesterol was 200 at baseline but rose to 350 by year 3 is still modeled as having cholesterol 200. The extended Cox model with time-varying covariates addresses this by allowing covariate values to update during follow-up.

The implementation uses the counting process formulation. Instead of one row per subject with a single entry-to-event time, the data are restructured so each subject contributes multiple rows, one per interval during which their covariates are constant. A patient observed from 0 to 5 years whose treatment changes at year 2 contributes two intervals: (0, 2] with the original treatment and (2, 5] with the new treatment. At each event time in the partial likelihood, the risk set includes all subjects under observation with their current covariate values. The mechanics of partial likelihood maximization are unchanged — only the data structure differs.

The most important pitfall is immortal time bias, which arises when a time-varying covariate is defined by a future event that requires survival. The classic example is organ transplantation: patients who eventually receive a transplant must survive the waiting period. If these patients are classified as "transplanted" from study entry, their pre-transplant survival is guaranteed (immortal time) and incorrectly attributed to the transplant's benefit. The correct analysis treats transplant as a time-varying covariate that switches from 0 to 1 at the actual transplant date, ensuring that the waiting period contributes to the untransplanted group.

A subtler issue is the distinction between external and internal time-varying covariates. External covariates (ambient temperature, policy changes, calendar time) exist independently of the subject. Internal covariates (biomarkers, symptoms, disease stage) are generated by the subject's own biological process and are informative about prognosis in ways that create feedback loops. A rising tumor marker both predicts and is part of the disease process leading to death. When internal covariates are measured with error or at irregular intervals, the extended Cox model can produce biased estimates, motivating the development of joint longitudinal-survival models.

Practice Questions 3 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIterated Integrals and Fubini's TheoremDouble Integrals in Cartesian CoordinatesDouble Integrals over Rectangular RegionsDouble Integrals in Polar CoordinatesDouble Integrals: Definition and SetupIterated Integrals and Fubini's TheoremDouble Integrals over Rectangular RegionsDouble Integrals over General RegionsApplications of Double Integrals: Area, Mass, and MomentsTriple Integrals in Cartesian CoordinatesTriple Integrals in Cylindrical and Spherical CoordinatesChange of Variables and the Jacobian DeterminantApplications of Triple Integrals: Volume and MassVector Fields and Their RepresentationsLine Integrals of Vector FieldsGreen's TheoremSurface Integrals and Flux of Vector FieldsSurface Integrals and Flux of Vector FieldsDivergence Theorem: Flux and OutflowDivergence TheoremElectric FluxGauss's LawConductors in Electrostatic EquilibriumCapacitance and CapacitorsDielectricsDielectric Constant and Relative PermittivityElectric Field Inside Dielectric MaterialsDielectric Materials and PolarizationDielectric Susceptibility and PermittivityEnergy Density in Electric FieldsElectric Current and Current DensityElectrical Resistance and ResistivityOhm's Law and Circuit ElementsElectromotive Force (EMF) and BatteriesKirchhoff's Circuit Laws: Voltage and CurrentDC Circuit Network Analysis MethodsTransient Response in RC CircuitsRC CircuitsLC and RLC CircuitsAC Circuits: FundamentalsImpedance and ReactanceAC Power and ResonanceElectromagnetic WavesThe Electromagnetic SpectrumBlackbody Radiation and Planck's LawPhotoelectric EffectThe Photon: Light as QuantaCompton ScatteringWave-Particle Dualityde Broglie WavelengthHeisenberg Uncertainty PrincipleWavefunction and the Born RuleThe Schrödinger EquationState Vectors and WavefunctionsQuantum SuperpositionQuantum EntanglementBell Theorem and Bell InequalitiesPostulates of Quantum MechanicsScattering TheoryIntroduction to Scattering TheoryPartial Wave Analysis in ScatteringSpin Angular MomentumElectron Spin and Intrinsic Magnetic MomentStern-Gerlach Experiment: Spin Quantization and MeasurementElectron Diffraction and Matter Wave PropertiesDavisson-Germer Experiment: Crystal Diffraction of ElectronsElectron Diffraction and Matter Wave InterferenceWavefunctions and Probability Density InterpretationQuantum Superposition and Linear Combinations of StatesQuantum Operators and ObservablesCanonical Commutation Relations and UncertaintyHeisenberg Uncertainty Principle and Measurement LimitsTime-Independent Schrödinger Equation and EigenvaluesHydrogen Atom in Quantum MechanicsSpectral Lines and Energy TransitionsSelection Rules for Atomic TransitionsLS and jj Coupling Schemes in Multi-Electron AtomsPauli Exclusion Principle and Antisymmetric WavefunctionsElectron Configuration and the Aufbau PrincipleThe Periodic Table and Atomic Electronic StructureThe Periodic TableElectron ConfigurationPeriodic TrendsIonization EnergyIonic BondingLewis StructuresResonance Structures and Delocalized ElectronsResonance and Formal ChargeMolecular Polarity and Dipole MomentsIntermolecular ForcesStates of Matter and Phase Changes: Melting, Boiling, and SublimationGas Laws and the Ideal Gas EquationGas Stoichiometry and Volume-Volume CalculationsThermochemistry and EnthalpyHeat Capacity and CalorimetryEntropy and Molecular DisorderSpontaneity and ΔGEntropy and Gibbs Free EnergyChemical EquilibriumAcid-Base ChemistryOrganic Reaction Mechanisms and Arrow PushingElectrophilic Addition to AlkenesAromaticity and BenzeneDNA StructureCentral Dogma of Molecular BiologyThe Genetic CodeDNA MutationsDNA Repair MechanismsCell Cycle Checkpoints and Cancer PreventionMitotic Spindle Checkpoint and Chromosome SegregationKinetochore Structure and FunctionMitochondria: Structure and FunctionCellular Respiration OverviewBacterial Metabolism OverviewAntibiotic Resistance MechanismsInfectious Disease EpidemiologyFoundations of EpidemiologyMeasuring Disease Frequency: Incidence and PrevalenceEpidemiologic Study DesignsStudy Design in BiostatisticsSurvival Analysis: Kaplan-Meier EstimationLog-Rank Test for Survival ComparisonCox Proportional Hazards ModelTime-Varying Covariates in Survival Models

Longest path: 190 steps · 942 total prerequisite topics

Prerequisites (1)

Leads To (1)