首页 > 解决方案 > R 函数 miperform_lr 给出错误“中断不是唯一的”

问题描述

我是这个论坛的新手,所以我希望我能以一种可以理解的方式描述我的问题。非常感谢您查看它。

在 R Studio 中,我使用一个名为miperform_lr(psfmi-package 的一部分)的函数来验证模型。但是,当我尝试运行该miperform_lr函数时,会出现以下错误:

“cut.default(pred.i[[i]], quantile(pred.i[[i]], c(seq(0,1,0.1)))) 中的错误:'breaks' 不是唯一的”

不幸的是,我无法进入 miperform_lr 函数,但这是一般语法:

"miperform_lr(data, nimp=5, impvar=NULL, Outcome, predictors=NULL, cat.predictors=NULL, int.predictors=NULL, cal.plot=FALSE, plot.indiv=FALSE, int.val=FALSE, method="boot", B=250, bw=FALSE, rule="p", type="individual", p.val=0.05, force=NULL)

我已经检查了哪个输入给出了问题,这是输入“预测变量”。对于预测变量,我使用了 4 个具有以下特征的变量:

- Variable A: dichotomous variable, 0 or 1
- Variable B: dichotomous variable, 0 or 1
- Variable C: dichotomous variable, 1 or 2
- Variable D: dichotomous variable, 1 or 2

有谁知道为什么我会收到上述错误?

标签: r

解决方案


可能您的预测概率范围正在缩小。您现在可以从 github 下载 miperform_lr 函数的新开发版本,您也可以使用 groups_cal =5 选择 5 个组。也许这对你有用。请参阅(https://github.com/mwheymans/psfmi)。


推荐阅读