You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

关于使用survIDINRI包IDI.INF函数比较Cox回归模型性能的问题求助

Troubleshooting Issues with IDI.INF from survIDINRI Package

I’ve used the IDI.INF function to compare Cox model performance before, so I can share some common troubleshooting steps based on the issues I’ve run into:

  • Verify model input types and data consistency
    The function requires both inputs to be valid coxph objects fitted on the exact same dataset. If one model uses a different subset of data, or isn’t a standard Cox model (e.g., includes custom non-standard terms), you’ll likely get errors.

    • Quick checks: Run class(model1) and class(model2) to confirm both return coxph, and compare dim(model1$data) and dim(model2$data) to ensure matching rows/columns.
  • Align outcome variable definitions
    Both Cox models must use identical survival outcomes (time + event status), including the coding of events (e.g., if one model uses status=1 for events and the other uses status=2, the function will fail to reconcile them).

    • Check: Compare model1$y and model2$y directly to ensure their structure and values match perfectly.
  • Clean up missing/extreme values
    Even if each model fits successfully, unhandled missing values or extreme outliers in the dataset can break the IDI/NRI calculation.

    • Fix: Preprocess your data with na.omit() before fitting either model to ensure no missing values are carried through.
  • Double-check parameter syntax
    The order of models and explicit data parameter matter. For example, if you used subset when fitting your Cox models, you must pass the full dataset to IDI.INF and ensure both models use the same subset logic.

    • Example of correct syntax:
      IDI.INF(model_old, model_new, data = your_full_dataset)
      
  • Update the survIDINRI package
    Older versions of the package have known bugs with certain Cox model configurations (like models with interaction terms or splines). Update to the latest version first:

    install.packages("survIDINRI")
    

If you can share the specific error message and a snippet of your code, we can narrow this down further—but these steps resolve most common issues I’ve encountered with IDI.INF.

内容的提问来源于stack exchange,提问作者Triade

火山引擎 最新活动