polr预测值聚集在MASS包的单个类中

时间:2013-08-15 01:11:59

标签: r mass-package

我在R中使用MASS包。我在下面的值上使用polr运行有序logit。但是,所有预测值都聚集在第6类中。我做错了吗?

x = rbind(
cbind(rep(1,1), runif(1,8.81,8.81)),
cbind(rep(2,63), runif(63,-2.25,12.84)),
cbind(rep(3,117), runif(117,0.11,15.87)),
cbind(rep(4,204), runif(204,-6.56,12.28)),
cbind(rep(5,291), runif(291,-4.05,26.97)),
cbind(rep(6,498), runif(498,-12.04,21.22)),
cbind(rep(7,69), runif(69,-13.94,11.5))
)

x=x[sort.list(x[,1]),]    
colnames(x) = c("y","x1")

p = polr(as.factor(y)~., x1)

table(predict(p))

0 个答案:

没有答案