Displaying 1 result from an estimated 1 matches for "a1b0".
Did you mean:
a10
2004 Jun 15
4
"Glueing" factors together
...e a series of cases each with categorical
factors A, B.
What is the best way to "glue" A and B together into a single
factor? For example, given
A0 B1 ...
A1 B1 ...
A0 B2 ...
A1 B0 ...
A0 B0 ...
A1 B2 ...
then I'd like to end up with a single factor with levels
A0B0, A0B1, A0B2, A1B0, A1B1, A1B2
according to all the combinations which actually occur in the
data (e.g. if (A1,B2) did not occur in the data, then A1B2 would
not be a level in the resulting "glued" factor).
I can see clumsy and tedious ways involving manipulating strings,
paste(), etc.; but I'm sure i...