简体   繁体   English

R中的警告消息顺序逻辑回归

[英]warning message ordinal logistic regression in R

This is my data head(both): 这是我的数据头(两者):

 season  gender age   prog     grade 
    fall    woman  old  FRIST       B
    fall    woman  old  FRIST       A 
    spring  woman  old  FRIST       E 
    spring    man  old  NMATK       C 
    spring  woman  old  NFYSK       A 
    fall    woman  old  FRIST       E 

I want to do logistic regression where grades are response variable. 我想进行逻辑回归,其中成绩是响应变量。 I want to make four of which are independent. 我要使其中四个是独立的。

Here: 这里:

E/A+B+C+D=alpha_1+beta^x_1+beta^y_1+...

D+E/A+B+C=alpha_2+beta^x_2+beta^y_2+...

C+D+E/A+B=alpha_3+beta^x_3+beta^y_3+...

B+C+D+E/A=alpha_4+beta^x_4+beta^y_4+...

What i have done: 我做了什么:

    library(MASS)
y <- factor(both$betyg)
mod.fit <- polr(y ~ prog + gender + age + season, data=both, Hess=TRUE)
summary(mod.fit) 

Then I get this message : 然后我收到此消息:

Warning message: In polr(y ~ prog + gender + age + season, data = both, Hess = TRUE) : design appears to be rank-deficient, so dropping some coefs 警告消息:在polr中(y〜prog +性别+年龄+季节,数据=两者,Hess = TRUE):设计似乎是等级不足的,因此要降低一些系数

I know this is not an error just a warning. 我知道这不是错误,只是警告。 I Do not know how to interpret it or what to do differently to avoid this message? 我不知道如何解释它,或者采取其他措施来避免此消息?

Since your outcome is ordered, you'll probably do better with ordinal, but may want to check the proportional odds assumption. 由于您的结果是有序的,因此使用序数可能会更好,但是可能要检查比例几率假设。 The model you're describing is pretty much what polr does, though they're not independent as you say. 您所描述的模型几乎是polr工作,尽管它们并不是您所说的独立。 UCLA has a good tutorial on this. UCLA在这方面有一个很好的教程。

As for determining which model is best, when dealing with fundamentally different types of models like these, I'd recommend cross-validation. 至于确定哪种模型最好,在处理根本不同类型的模型时,我建议进行交叉验证。 Prediction accuracy doesn't lie, and any pseudo-R^2 metrics will differ in interpretation across models. 预测准确性并不重要,并且任何伪R ^ 2指标在模型之间的解释都将有所不同。

Also, since this question concerns statistics more than R coding/implementation, I'd recommend CrossValidated (the stats StackExchange site). 此外,由于此问题比R编码/实现更关注统计信息,因此我建议使用CrossValidated(Status StackExchange网站)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM