2

假设我有这个数据集:

require(rms)

newdata <- data.frame(eduattain = rep(c(1,2,3), times=2), dadedu=rep(c(1,2,3),each=2),
                      random=rnorm(6, mean(1000),sd=50))

我将因变量和自变量都转换为因子

newdata$eduattain <- factor(newdata$eduattain, levels = 1:3, labels = c("L1","L2","L3"),
                            ordered = T)
newdata$dadedu <- factor(newdata$dadedu, levels = 1:3, labels = c("L1","L2","L3"))

并使用权重进行简单的有序逻辑回归:

model1 <- lrm(eduattain ~ dadedu, data=newdata, weights = random, normwt = T)

警告信息:

In lrm(eduattain ~ dadedu, data = newdata, weights = random, normwt = T) :
  currently weights are ignored in model validation and bootstrapping lrm fits

我有理由相信,如果使用权重,结果会完全不同。

我该如何解决?大多数解决这个警告的问题都没有给出这个特定警告的正确答案。(这里这里这里

4

1 回答 1

0

有人需要修改包validate.lrmpredab.resample的代码rms。代码在 github 上https://github.com/harrelfe/rms

于 2015-12-05T00:02:28.743 回答