[R] working with ordinal predictor variables?

MacQueen, Don macqueen1 at llnl.gov
Fri Oct 6 01:43:39 CEST 2017

Try looking at the help page for factor
for something to start with.

Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
Lab cell 925-724-7509

On 10/5/17, 10:54 AM, "R-help on behalf of Alexandra Thorn" <r-help-bounces at r-project.org on behalf of alexandra.thorn at gmail.com> wrote:

    I'm trying to develop a linear model for crop productivity based on
    variables published as part of the SSURGO database released by the
    USDA.  My default is to just run lm() with continuous predictor
    variables as numeric, and discrete predictor variables as factors, but
    some of the discrete variables are ordinal (e.g. drainage class, which
    ranges from excessively drained to excessively poorly drained), but
    this doesn't make use of the fact that the predictor variables have a
    known order.
    How do I correctly set up a regression model (with lm or similar) to
    detect the influence of ordinal variables?
    How will the output differ compared to the dummy variable outputs for
    unordered categorical variables.
    R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
    PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
    and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list