Hi, I am running an analysis with an ordinal outcome and I need to run a test of the parallel regression assumption to determine if ordinal logistic regression is appropriate. I cannot find a function to conduct such a test.>From searching various message boards I have seen a few useRs ask this samequestion without a definitive answer - and I came across a thread that indicated there is no such function available in any R packages. I hope this is incorrect. Does anyone know how to test the parallel regression assumption in R? Thanks for your help! -- Heather Hensman Kettrey PhD Candidate Department of Sociology Vanderbilt University [[alternative HTML version deleted]]
Heather: You are at Vanderbilt, whose statistics department under Frank Harrell is a veritable bastion of R and statistical wisdom. I strongly recommend that you take a stroll over there in the lovely spring weather and seek their help. I can't imagine how you could do better than that! Cheers, Bert On Mon, Mar 11, 2013 at 2:02 PM, Heather Kettrey <heather.h.kettrey at vanderbilt.edu> wrote:> Hi, > > I am running an analysis with an ordinal outcome and I need to run a test > of the parallel regression assumption to determine if ordinal logistic > regression is appropriate. I cannot find a function to conduct such a test. > >From searching various message boards I have seen a few useRs ask this same > question without a definitive answer - and I came across a thread that > indicated there is no such function available in any R packages. I hope > this is incorrect. > > Does anyone know how to test the parallel regression assumption in R? > > Thanks for your help! > > > -- > Heather Hensman Kettrey > PhD Candidate > Department of Sociology > Vanderbilt University > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > 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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm
Perhaps you should be asking whether such an algorithm exists, regardless of whether it is already implemented in R. However, this is the wrong place to ask such theory questions... your local statistics expert might know, or you could ask on a statistics theory forum such as stats.stackexchange.com. With the answer to that question you could use the RSiteSeek function to search for references to that algorithm, or even implement it yourself. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Heather Kettrey <heather.h.kettrey at vanderbilt.edu> wrote:>Hi, > >I am running an analysis with an ordinal outcome and I need to run a >test >of the parallel regression assumption to determine if ordinal logistic >regression is appropriate. I cannot find a function to conduct such a >test. >>From searching various message boards I have seen a few useRs ask this >same >question without a definitive answer - and I came across a thread that >indicated there is no such function available in any R packages. I hope >this is incorrect. > >Does anyone know how to test the parallel regression assumption in R? > >Thanks for your help!
here's some code as an example.... hope it helps! mod<-polr(vote~age+demsat+eusup+lrself+male+retnat+union+urban, data=dat) summary(mod) mod<-polr(vote~age+demsat+eusup+lrself+male+retnat+union+urban, data=dat) levs<-levels(dat$vote) tmpdat<-list() for(i in 1:(nlevels(dat$vote)-1)){ tmpdat[[i]] <- dat tmpdat[[i]]$z <- as.numeric(as.numeric(tmpdat[[1]]$vote) <= levs[i]) } form<-as.formula("z~age+demsat+eusup+lrself+male+retnat+union+urban") mods<-lapply(tmpdat, function(x)glm(form, data=x, family=binomial)) probs<-sapply(mods, predict, type="response") p.logits<-cbind(probs[,2], t(apply(probs, 1, diff)), 1-probs[,ncol(probs)]) p.ologit<-predict(mod, type='probs') n<-nrow(p.logits) bin.ll <- p.logits[cbind(1:n, dat$vote)] ologit.ll <- p.ologit[cbind(1:n, dat$vote)] binom.test(sum(bin.ll > ologit.ll), n) dat$vote.fac<-factor(dat$vote, levels=1:6) mod<-polr(dat$vote.fac~age+demsat+eusup+lrself+male+retnat+union+urban, data=dat) source("http://www.quantoid.net/cat_pre.R ") catpre(mod) install.packages("rms") library(rms) olprobs<-predict(mod, type='probs') pred.cat<-apply(olprobs, 1, which.max) table(pred.cat, dat$vote) round(prop.table(table(pred.cat, dat$vote), 2), 3) On Mar 11, 2013, at 5:02 PM, Heather Kettrey wrote:> Hi, > > I am running an analysis with an ordinal outcome and I need to run a test > of the parallel regression assumption to determine if ordinal logistic > regression is appropriate. I cannot find a function to conduct such a test. >> From searching various message boards I have seen a few useRs ask this same > question without a definitive answer - and I came across a thread that > indicated there is no such function available in any R packages. I hope > this is incorrect. > > Does anyone know how to test the parallel regression assumption in R? > > Thanks for your help! > > > -- > Heather Hensman Kettrey > PhD Candidate > Department of Sociology > Vanderbilt University > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > 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]]