From @purd|e@@ @end|ng |rom gm@||@com  Sat Aug 31 02:20:33 2019
From: @purd|e@@ @end|ng |rom gm@||@com (Abby Spurdle)
Date: Sat, 31 Aug 2019 12:20:33 +1200
Subject: [Rd] inconsistent handling of factor, character,
 and logical predictors in lm()
In-Reply-To: <ACD1644AA6C67E4FBD0C350625508EC836CF0E5B@FHSDB2D11-2.csu.mcmaster.ca>
References: <ACD1644AA6C67E4FBD0C350625508EC836CF0E5B@FHSDB2D11-2.csu.mcmaster.ca>
Message-ID: <CAB8pepxHcs6gzhkCQsHZh1ZUmPSXPQyTkYs=K+fmK=M1Zicr3Q@mail.gmail.com>

> 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).



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