[R] why change days of the week from a factor to an ordered factor?

S Ellison S.Ellison at LGCGroup.com
Tue Dec 3 18:29:16 CET 2013


> There are two reasons. First is that in the "day_of_week", the starting day is
> Friday so if you plot a graph, the left most column will start with Friday. You
> may like to start the column with Monday. 

Plotting levels in a particular order by default does not usually require an ordered factor. It only requires that the levels are specified in the desired plotting order. without ...,ordered=TRUE  that does not generate an ordered factor.

But specifying an ordered factor changes default contrasts in modelling; see ?contrasts for details. That in turn changes the fitted model rather considerably. It isn't generally sensible to specify ordered factors unless there really is order that you want to explore.

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list