[R] ordered and unordered variables

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed May 22 11:30:34 CEST 2013



On 22.05.2013 07:09, meng wrote:
> Thanks.
>
>
> As to the data " warpbreaks", if I want to analysis the impact of tension(L,M,H) on breaks, should I order the tension or not?

No homework questions on this list, please ask your teacher.

Best,
Uwe Ligges





>
>
> Many thanks.
>
>
>
>
>
>
>
>
>
>
>
>
> At 2013-05-21 20:55:18,"David Winsemius" <dwinsemius at comcast.net> wrote:
>>
>> On May 20, 2013, at 10:35 PM, meng wrote:
>>
>>> Hi all:
>>> If the explainary variables are ordinal,the result of regression is different from
>>> "unordered variables".But I can't understand the result of regression from "ordered
>>> variable".
>>>
>>> The data is warpbreaks,which belongs to R.
>>>
>>> If I use the "unordered variable"(tension):Levels: L M H
>>> The result is easy to understand:
>>>     Estimate Std. Error t value Pr(>|t|)
>>> (Intercept)    36.39       2.80  12.995  < 2e-16 ***
>>> tensionM      -10.00       3.96  -2.525 0.014717 *
>>> tensionH      -14.72       3.96  -3.718 0.000501 ***
>>>
>>> If I use the "ordered variable"(tension):Levels: L < M < H
>>> I don't know how to explain the result:
>>>            Estimate Std. Error t value Pr(>|t|)
>>> (Intercept)   28.148      1.617  17.410  < 2e-16 ***
>>> tension.L    -10.410      2.800  -3.718 0.000501 ***
>>> tension.Q      2.155      2.800   0.769 0.445182
>>>
>>> What's "tension.L" and "tension.Q" stands for?And how to explain the result then?
>>
>> Ordered factors are handled by the R regression mechanism with orthogonal polynomial contrasts: ".L" for linear and ".Q" for quadratic. If the term had 4 levels there would also have been a ".C" (cubic) term. Treatment contrasts are used for unordered factors. Generally one would want to do predictions for explanations of the results. Trying to explain the individual coefficient values from polynomial contrasts is similar to and just as unproductive as trying to explain the individual coefficients involving interaction terms.
>>
>> --
>>
>> David Winsemius
>> Alameda, CA, USA
>>
>
> 	[[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.
>



More information about the R-help mailing list