-Original Message-
> From: Bert Gunter [mailto:bgunter.4...@gmail.com]
> Sent: 22 August 2017 20:38
> To: Stephen O'hagan <soha...@manchester.ac.uk>
> Cc: r-help@r-project.org
> Subject: Re: [R] boot.stepAIC fails with computed formula
>
> OK, here's the problem. Continu
unter [mailto:bgunter.4...@gmail.com]
>> Sent: 22 August 2017 20:38
>> To: Stephen O'hagan <soha...@manchester.ac.uk>
>> Cc: r-help@r-project.org
>> Subject: Re: [R] boot.stepAIC fails with computed formula
>>
>> OK, here's the problem. Continuing with your e
.@gmail.com]
Sent: 22 August 2017 20:38
To: Stephen O'hagan <soha...@manchester.ac.uk>
Cc: r-help@r-project.org
Subject: Re: [R] boot.stepAIC fails with computed formula
OK, here's the problem. Continuing with your example:
strt1 <- lm(y1 ~1, dat)
strt2 <- lm(frm1,dat)
strt1
Call:
lm(form
8:51
To: Stephen O'hagan <soha...@manchester.ac.uk>
Cc: r-help@r-project.org
Subject: Re: [R] boot.stepAIC fails with computed formula
SImplify your call to lm using the "." argument instead of manipulating
formulas.
> strt <- lm(y1 ~ ., data = dat)
and you do not need to
oha...@manchester.ac.uk>
Cc: r-help@r-project.org
Subject: Re: [R] boot.stepAIC fails with computed formula
OK, here's the problem. Continuing with your example:
strt1 <- lm(y1 ~1, dat)
strt2 <- lm(frm1,dat)
> strt1
Call:
lm(formula = y1 ~ 1, data = dat)
Coefficients:
(Intercept)
OK, here's the problem. Continuing with your example:
strt1 <- lm(y1 ~1, dat)
strt2 <- lm(frm1,dat)
> strt1
Call:
lm(formula = y1 ~ 1, data = dat)
Coefficients:
(Intercept)
41.73
> strt2
Call:
lm(formula = frm1, data = dat)
Coefficients:
(Intercept)
41.73
Note that the
SImplify your call to lm using the "." argument instead of
manipulating formulas.
> strt <- lm(y1 ~ ., data = dat)
and you do not need to explicitly specify the "1+" on the rhs for lm, so
> frm2<-as.formula(paste(trg," ~ ", paste(xvars,collapse = "+")))
works fine, too.
Anyway, doing this
Failed? What was the error message?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Tue, Aug 22, 2017 at 8:17 AM, Stephen O'hagan
The error is "the model fit failed in 50 bootstrap samples
Error: non-character argument"
Cheers,
SOH.
On 22/08/2017 17:52, Bert Gunter wrote:
Failed? What was the error message?
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking
I'm trying to use boot.stepAIC for feature selection; I need to be able to
specify the name of the dependent variable programmatically, but this appear to
fail:
In R-Studio with MS R Open 3.4:
library(bootStepAIC)
#Fake data
n<-200
x1 <- runif(n, -3, 3)
x2 <- runif(n, -3, 3)
x3 <- runif(n,
10 matches
Mail list logo