[Rd] inconsistent handling of factor, character, and logical predictors in lm()

Abby Spurdle @purd|e@@ @end|ng |rom gm@||@com
Sat Aug 31 02:20:33 CEST 2019


> I think that it would be better to handle factors, character predictors, and logical predictors consistently.

"logical predictors" can be regarded as categorical or continuous (i.e. 0 or 1).
And the model matrix should be the same, either way.

I think the first question to be asked is, which is the best approach,
categorical or continuous?
The continuous approach seems simpler and more efficient to me, but
output from the categorical approach may be more intuitive, for some
people.

I note that the use factors and characters, doesn't necessarily
produce consistent output, for $xlevels.
(Because factors can have their levels re-ordered).



More information about the R-devel mailing list