Skip to content
Prev 307606 / 398506 Next

lm on matrix data

On Wed, Oct 10, 2012 at 3:35 PM, Baoqiang Cao <bqcaomail at gmail.com> wrote:
I think you want a formula like

trainy ~ .

meaning "trainy" explained by everything else. (Admittedly, I think
any model with 220 regressors is going to be absolutely terrible, but
that's a different email)

What I think is happening here is that lm() looks for "trainx" as a
column name in the data set you provide, can't find it, and then finds
the "trainx" dataset as a whole, which doesn't fit the dimensionality
you need. Take a look at ?formula for more on how to use formula
notation properly.

Cheers,
Michael