Dear friends,
Being very new to this, I was wondering if I could get some pointers
and guidance to interpreting the results of performing a linear
regression with ordinal predictors in R.
Here is a simple, toy example:
y <- c(-0.11, -0.49, -1.10, 0.08, 0.31, -1.21, -0.05, -0.40, -0.01,
-0.12, 0.55, 1.34, 1.00, -0.31, -0.73, -1.68, 0.38, 1.22,
-1.11, -0.20)
x <- ordered(c(2, 3, 3, 3, 5, 1, 2, 2, 1, 6, 0, 3, 4, 2, 2, 4, 1, 1, 1,
1))
x
# [1] 2 3 3 3 5 1 2 2 1 6 0 3 4 2 2 4 1 1 1 1
# Levels: 0 < 1 < 2 < 3 < 4 < 5 < 6
lm(formula = y ~ x)
# Call:
# lm(formula = y ~ x)
# Coefficients:
# (Intercept) x.L x.Q x.C x^4 x^5
# -0.01679 -0.20788 0.46917 -0.45520 -0.05721 -0.28696
# x^6
# -0.31417
....
Question: What exactly, does x.L, x.Q, x.C, x^4, etc stand for? How do
these names, etc get assigned in the coefficients? Where do I find more
about this information?
Note that my question is not on lm (I think), but rather on how lm
outputs the results of regressions involving ordered predictors. Some
references would be great.
Please post responses to this mailing list.
Thanks very much again for all your help!
Best wishes,
Ranjan
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. For those needing to send personal or professional
e-mail, please use appropriate addresses.
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!
Dear friends,
Being very new to this, I was wondering if I could get some pointers
and guidance to interpreting the results of performing a linear
regression with ordinal predictors in R.
Here is a simple, toy example:
y <- c(-0.11, -0.49, -1.10, 0.08, 0.31, -1.21, -0.05, -0.40, -0.01,
-0.12, 0.55, 1.34, 1.00, -0.31, -0.73, -1.68, 0.38, 1.22,
-1.11, -0.20)
x <- ordered(c(2, 3, 3, 3, 5, 1, 2, 2, 1, 6, 0, 3, 4, 2, 2, 4, 1, 1,
1,
1))
x
# [1] 2 3 3 3 5 1 2 2 1 6 0 3 4 2 2 4 1 1 1 1
# Levels: 0 < 1 < 2 < 3 < 4 < 5 < 6
lm(formula = y ~ x)
# Call:
# lm(formula = y ~ x)
# Coefficients:
# (Intercept) x.L x.Q x.C
x^4 x^5
# -0.01679 -0.20788 0.46917 -0.45520 -0.05721
-0.28696
# x^6
# -0.31417
....
Question: What exactly, does x.L, x.Q, x.C, x^4,
x.L, linear
x.Q, quadratic
x.C, cubic
x^4 quartic
etc stand for? How do
these names, etc get assigned in the coefficients? Where do I find
more
about this information?
Search on "orthogonal polynomials".
Note that my question is not on lm (I think), but rather on how lm
outputs the results of regressions involving ordered predictors. Some
references would be great.
Please post responses to this mailing list.
Below ...
-- Bert
On Wed, Jan 2, 2013 at 9:54 PM, David Winsemius <dwinsemius at comcast.net
wrote:
...
Search on "orthogonal polynomials".
Yes, but this does not explain what these have to do with ordered
factors and contrasts in a linear model.
That information is contained in "An Introduction to R," the
tutorial that ships with R and which the OP should have perused
before posting. Detailed explanation beyond that is too technical
for here, I would say.
David.
>
> -- Bert
>
>
>
>
> Note that my question is not on lm (I think), but rather on how lm
> outputs the results of regressions involving ordered predictors. Some
> references would be great.
>
> Please post responses to this mailing list.
>
>
> As always.
>
> Thanks very much again for all your help!
>
>
> --
>
>
> David Winsemius, MD
> Alameda, CA, USA
>
> ______________________________________________
> 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
>
David Winsemius, MD
Alameda, CA, USA