Introduction: We used agent-based simulation to examine the problem of time-varying confounding when estimating the effect of an adverse event on hospital length of stay. Conventional analytic methods were compared with inverse probability weighting (IPW).
Methods: A cohort of hospitalized patients, at risk for experiencing an adverse event, was simulated. Synthetic individuals were assigned a severity of illness score on admission. The score varied during hospitalization according to an autoregressive equation. A linear relationship between severity of illness and the logarithm of the discharge rate was assumed. Depending on the model conditions, adverse event status was influenced by prior severity of illness and, in turn, influenced subsequent severity. Conditions were varied to represent different levels of confounding and categories of effect. The simulation output was analyzed by Cox proportional hazards regression and by a weighted regression analysis, using the method of IPW. The magnitude of bias was calculated for each method of analysis.
Results: Estimates of the population causal hazard ratio based on IPW were consistently unbiased across a range of conditions. In contrast, hazard ratio estimates generated by Cox proportional hazards regression demonstrated substantial bias when severity of illness was both a time-varying confounder and intermediate variable. The direction and magnitude of bias depended on how severity of illness was incorporated into the Cox regression model.
Conclusions: In this simulation study, IPW exhibited less bias than conventional regression methods when used to analyze the impact of adverse event status on hospital length of stay.