Skip to content
Prev 301345 / 398503 Next

regression analysis

Something like that should work, though you might need to construct
the formula as a string:

paste("y ~", names(x)[i])

instead.

More worrisome is the methodology: doing 10k regressions on a single
response is almost guaranteed to give spurious results. This
methodological mistake has different names in different fields, but
it's not too hard to illustrate:

If I have 10 patients with a rare disease and a list of what each of
them had for dinner for each night over the last 20 years, it's
practically guaranteed, that on one night, perhaps 1562 days ago, they
all had fish tacos for dinner. But to conclude that fish tacos cause
my rare disease on a 4 and a quarter year lag strains credibility....

I'll let you work out the details.

Michael
On Wed, Jul 25, 2012 at 4:03 PM, Silvano Cesar da Costa <silvano at uel.br> wrote: