Skip to content
Prev 2033 / 7420 Next

Linear Model of Data in Matrix Form

Thanks, but that doesn't quite work. Using your toy example gives an
error about variable lengths.
X1 X2 value
1  1  4     1
2  2  4     2
3  3  4     3
4  1  5     4
5  2  5     5
6  3  5     6
7  1  6     7
8  2  6     8
9  3  6     9
Error in model.frame.default(formula = z ~ z.melt$X1 + z.melt$X2,
drop.unused.levels = TRUE) :
  variable lengths differ (found for 'z.melt$X1')

I'm using R 2.12.0 on Windows and just installed the reshape package.

Jane
On Sun, Apr 3, 2011 at 3:40 PM, Ben Bolker <bbolker at gmail.com> wrote: