Perfectly clear. Thanks!
Best,
Wolfgang
On Sat, 13 Nov 2021, Duncan Murdoch wrote:
On 13/11/2021 2:24 p.m., Viechtbauer, Wolfgang (SP) wrote:
Hello all,
Say I would like to change the outcome in a formula to a variable not part
of the original dataset. This works just fine:
res <- lm(mpg ~
On 13/11/2021 2:24 p.m., Viechtbauer, Wolfgang (SP) wrote:
Hello all,
Say I would like to change the outcome in a formula to a variable not part of
the original dataset. This works just fine:
res <- lm(mpg ~ wt + cyl, data=mtcars)
res
y <- rnorm(nobs(x))
update(x, formula = y ~ .)
But not whe
Hello all,
Say I would like to change the outcome in a formula to a variable not part of
the original dataset. This works just fine:
res <- lm(mpg ~ wt + cyl, data=mtcars)
res
y <- rnorm(nobs(x))
update(x, formula = y ~ .)
But not when doing so within a function:
rm(y)
f <- function(x) {
y
3 matches
Mail list logo