Skip to content
Prev 280073 / 398506 Next

shorter way of coding

That's not a reproducible example. Paul suggested a list of formulas,
but I recommended creating a list of y variables.

In your attempt, you didn't include the y in the name of the dependent
variable; that's probably why it doesn't work.

Look at this:
$y1

Call:
lm(formula = y ~ x1)

Coefficients:
(Intercept)           x1
    0.56392     -0.02586


[[2]]

Call:
lm(formula = y ~ x1)

Coefficients:
(Intercept)           x1
    0.66375     -0.03519


[[3]]

Call:
lm(formula = y ~ x1)

Coefficients:
(Intercept)           x1
    0.29106      0.02845

Sarah

On Mon, Dec 12, 2011 at 11:21 AM, Mintewab Bezabih
<Mintewab.Bezabih at economics.gu.se> wrote: