R中的临床预测规则(校准,鉴别和验证)

时间:2018-05-16 11:20:32

标签: r

这是我能够创建的glm模型,但我现在想要进行Hosmer Lemeshow GOF测试但得到这个我不明白的错误 -

Call:
glm(formula = BC.result ~ Diabetic + Low.diastolic + Pulse, family = 
"binomial", data = Data2)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.0805  -0.4559  -0.3144  -0.2437   2.8259  

 Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)   -5.86311    0.98715  -5.939 2.86e-09 ***
Diabetic       1.21963    0.37395   3.262 0.001108 ** 
Low.diastolic  1.27095    0.35074   3.624 0.000291 ***
Pulse          0.02361    0.00780   3.027 0.002470 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 276.40  on 485  degrees of freedom
Residual deviance: 249.71  on 482  degrees of freedom
(14 observations deleted due to missingness)
AIC: 257.71
> hl<- hoslem.test(model3$BC.result, fitted(model3, g=10))
Error in model.frame.default(formula = cbind(y0 = 1 - y, y1 = y) ~ cutyhat) 
: 
variable lengths differ (found for 'cutyhat')

任何人都可以通过Hosmer Lemeshow适合度测试来解释这个错误吗?

由于

0 个答案:

没有答案