Dear all, A quick question: Let?s say I have a full and a restricted model that looks something like this: Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression Restricted<- polr(Y ~ X1+X2+X3, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression I wanted to conduct the F-test (using aov command) in order to determine whether the information from the X4 variable statistically improves our understanding of Y. However, I?ve been told that the likelihood ratio test is a better alternative. So, I would like to conduct the LR test. In rms package this is easy -- lrest(Full, Restricted) ? I?m just curious how to perform the same using polr. Thanks! [[alternative HTML version deleted]]
On Wed, 27 Jul 2016, Faradj Koliev wrote:> Dear all, > > A quick question: Let?s say I have a full and a restricted model that looks something like this: > > Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression > > Restricted<- polr(Y ~ X1+X2+X3, data=data, Hess = TRUE, method="logistic?) # ordered logistic regression > > I wanted to conduct the F-test (using aov command) in order to determine whether the information from the X4 variable statistically improves our understanding of Y. > However, I?ve been told that the likelihood ratio test is a better alternative. So, I would like to conduct the LR test. In rms package this is easy -- lrest(Full, Restricted) ? I?m just curious how to perform the same using polr. Thanks!One generic possibility to conduct the likelihood ratio test is the lrtest() function in package "lmtest", i.e., library("lmtest") lrtest(Restricted, Full)> [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Dear Faradj Koliev, There is an anova() method for "polr" objects that computes LR chisquare tests for nested models, so a short answer to your question is anova(Full, Restricted). The question, however, seems to reflect some misunderstandings. First aov() fits linear analysis-of-variance models, which assume normally distributed errors. These are different from the ordinal regression models, such as the proportional-odds model, fit by polr(). For the former, F-tests *are* LR tests; for the latter, F-tests aren't appropriate. I hope this helps, John ----------------------------- John Fox, Professor McMaster University Hamilton, Ontario Canada L8S 4M4 Web: socserv.mcmaster.ca/jfox> -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Faradj Koliev > Sent: July 27, 2016 4:50 AM > To: r-help at r-project.org > Subject: [R] Likelihood ratio test in porl (MASS) > > Dear all, > > A quick question: Let?s say I have a full and a restricted model that looks > something like this: > > Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # > ordered logistic regression > > Restricted<- polr(Y ~ X1+X2+X3, data=data, Hess = TRUE, method="logistic?) # > ordered logistic regression > > I wanted to conduct the F-test (using aov command) in order to determine > whether the information from the X4 variable statistically improves our > understanding of Y. > However, I?ve been told that the likelihood ratio test is a better alternative. So, > I would like to conduct the LR test. In rms package this is easy -- lrest(Full, > Restricted) ? I?m just curious how to perform the same using polr. Thanks! > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Dear Achim Zeileis, dear John Fox, Thank you for your time! Both worked well. lrtest(Restrict, Full) #Df LogLik Df Chisq Pr(>Chisq) 1 27 -882.00 2 28 -866.39 1 31.212 2.313e-08 *** anova(Restrict, Full) Resid. df Resid. Dev Test Df LR stat. Pr(Chi) 1 2121 1763.999 2 2120 1732.787 1 vs 2 1 31.21204 2.313266e-08 And both seems to reject the null hypothesis. Thanks again! Best, Faradj> 27 jul 2016 kl. 13:35 skrev Fox, John <jfox at mcmaster.ca>: > > Dear Faradj Koliev, > > There is an anova() method for "polr" objects that computes LR chisquare tests for nested models, so a short answer to your question is anova(Full, Restricted). > > The question, however, seems to reflect some misunderstandings. First aov() fits linear analysis-of-variance models, which assume normally distributed errors. These are different from the ordinal regression models, such as the proportional-odds model, fit by polr(). For the former, F-tests *are* LR tests; for the latter, F-tests aren't appropriate. > > I hope this helps, > John > > ----------------------------- > John Fox, Professor > McMaster University > Hamilton, Ontario > Canada L8S 4M4 > Web: socserv.mcmaster.ca/jfox > > > > >> -----Original Message----- >> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Faradj Koliev >> Sent: July 27, 2016 4:50 AM >> To: r-help at r-project.org >> Subject: [R] Likelihood ratio test in porl (MASS) >> >> Dear all, >> >> A quick question: Let?s say I have a full and a restricted model that looks >> something like this: >> >> Full<- polr(Y ~ X1+X2+X3+X4, data=data, Hess = TRUE, method="logistic?) # >> ordered logistic regression >> >> Restricted<- polr(Y ~ X1+X2+X3, data=data, Hess = TRUE, method="logistic?) # >> ordered logistic regression >> >> I wanted to conduct the F-test (using aov command) in order to determine >> whether the information from the X4 variable statistically improves our >> understanding of Y. >> However, I?ve been told that the likelihood ratio test is a better alternative. So, >> I would like to conduct the LR test. In rms package this is easy -- lrest(Full, >> Restricted) ? I?m just curious how to perform the same using polr. Thanks! >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]