Hi I would like to analyse an ordinal categorical variable. I know how I can analyse a nominal categorical variable (with multinom or if there are only two levels with glm). Does somebody know which command I need in R to analyse an ordinal categorical variable? I want to describe the variable y with the variables x1,x2,x3 and x4. So my model looks like: y ~ x1+x2+x3+x4. y: ordinal factor variable with levels (never, rare, bychance, often). Thanks a lot in advance Thomas
Dear Thomas, One approach to an ordinal response variable is the proportional-odds model, implemented in the MASS package as polr(). The proportional-odds assumption may not hold, however. I hope this helps, John> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > thsudler at swissonline.ch > Sent: Wednesday, May 05, 2004 7:45 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Analysis of ordinal categorical data > > Hi > > I would like to analyse an ordinal categorical variable. I > know how I can analyse a nominal categorical variable (with > multinom or if there are only two levels with glm). > > Does somebody know which command I need in R to analyse an > ordinal categorical variable? > > I want to describe the variable y with the variables x1,x2,x3 > and x4. So my model looks like: y ~ x1+x2+x3+x4. > > y: ordinal factor variable with levels (never, rare, bychance, often). > > Thanks a lot in advance > Thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
Thanks a lot for your advice. What do you mean with "the proportional-odds assumption may not hold"? Does this solution with "polr" always works? Or what's important to take into account? Regards Thomas>Dear Thomas, > >One approach to an ordinal response variable is the proportional-odds model, >implemented in the MASS package as polr(). The proportional-odds >assumption >may not hold, however. > >I hope this helps, > John > > -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch > [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of > thsudler at swissonline.ch > Sent: Wednesday, May 05, 2004 7:45 AM > To: r-help at stat.math.ethz.ch > Subject: [R] Analysis of ordinal categorical data > > Hi > > I would like to analyse an ordinal categorical variable. I > know how I can analyse a nominal categorical variable (with > multinom or if there are only two levels with glm). > > Does somebody know which command I need in R to analyse an > ordinal categorical variable? > > I want to describe the variable y with the variables x1,x2,x3 > and x4. So my model looks like: y ~ x1+x2+x3+x4. > > y: ordinal factor variable with levels (never, rare, bychance, often). > > Thanks a lot in advance > Thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
On Wed, 5 May 2004, John Fox wrote:> One approach to an ordinal response variable is the proportional-odds model, > implemented in the MASS package as polr(). The proportional-odds assumption > may not hold, however.And you can find out by comparing the fit with a multinom fit -- see the MASS scripts for a worked example. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Thomas, R code for Agresti's book "Catagorical Data Analysis is available on Laura Thompson's web site. http://math.cl.uh.edu/~thompsonla/ You might find the book and the code helpful. Paul On 5 May 2004, at 13:45, thsudler at swissonline.ch wrote:> Hi > > I would like to analyse an ordinal categorical variable. I know how I > can analyse a nominal categorical variable (with multinom or if there > are only two levels with glm). > > Does somebody know which command I need in R to analyse an ordinal > categorical variable? > > I want to describe the variable y with the variables x1,x2,x3 and x4. > So my model looks like: y ~ x1+x2+x3+x4. > > y: ordinal factor variable with levels (never, rare, bychance, often). > > Thanks a lot in advance > Thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >P. B. Pynsent, Research & Teaching Centre, Royal Orthopaedic Hospital, Northfield, Birmingham, B31 2AP, U. K.
Reasonably Related Threads
- Regression models for ordinal responses ??
- R Libraries for ORDINAL categorical data
- Regression trees with an ordinal response variable
- Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'
- Using VGAM's vglm function for ordinal logistic regression