Displaying 20 results from an estimated 10000 matches similar to: "formulas with non-syntactic names and an Error() term"
2004 Jan 30
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with suggested (PR#6510)
I think there are two bugs in aov() that shows up when the right hand
side of `formula' contains both `-1' and an Error() term, e.g.,
aov(y ~ a + b - 1 + Error(c), ...). Without `-1' or `Error()' there
is no problem. I've included and example, and the source of aov()
with suggested fixes below.
The first bug (labeled BUG 1 below) creates an extra, empty stratum
inside
2004 Feb 02
0
Two apparent bugs in aov(y~ *** -1 + Error(***)), with (PR#6520)
I believe you are right, but can you please explain why anyone would want
to fit this model? It differs only in the coding from
aov(y ~ a + b + Error(c), data=test.df)
and merely lumps together the top two strata.
There is a much simpler fix: in the line
if(intercept) nmstrata <- c("(Intercept)", nmstrata)
remove the condition (and drop the empty stratum later if you
2017 Aug 22
1
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 explicitly specify the "1+" on the rhs for lm, so
> frm2<-as.formula(paste(trg," ~ ", paste(xvars,collapse = "+")))
works fine, too.
Anyway, doing this gives (but see end of output)"
bst <-
2017 Aug 22
1
boot.stepAIC fails with computed formula
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
<SOhagan at manchester.ac.uk> wrote:
> I'm trying to use boot.stepAIC for
2017 Aug 22
0
boot.stepAIC fails with computed formula
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 things into it."
> -- Opus (aka
2004 Jul 10
1
read.table, read.fwf, and na.strings (PR#7075)
# Your mailer is set to "none" (default on Windows),
# hence we cannot send the bug report directly from R.
# Please copy the bug report (after finishing it) to
# your favorite email program and send it to
#
# r-bugs@r-project.org
#
######################################################
Is this intended behavior for the read.fwf(na.strings="-999")?
I anticipated that
2012 Dec 03
2
Different results from random.Forest with test option and using predict function
Hello R Gurus,
I am perplexed by the different results I obtained when I ran code like
this:
set.seed(100)
test1<-randomForest(BinaryY~., data=Xvars, trees=51, mtry=5, seed=200)
predict(test1, newdata=cbind(NewBinaryY, NewXs), type="response")
and this code:
set.seed(100)
test2<-randomForest(BinaryY~., data=Xvars, trees=51, mtry=5, seed=200,
xtest=NewXs, ytest=NewBinarY)
The
2003 Mar 04
3
question on latticeParseFormula (PR#2602)
This feels like inconsistent behavior. latticeParseFormula works the
way I anticipated for factor, but not for ordered. I want the
behavior I see with tmp2, but not with tmp. My next step is to use
the right.name to isolate the tmp2[,c("a","b")] columns.
tmp <- data.frame(y=(1:12)+.1,
a=factor(rep(1:3,4)),
b=ordered(rep(1:4,
2017 Aug 22
0
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)
41.73
> strt2
Call:
lm(formula = frm1, data = dat)
Coefficients:
(Intercept)
41.73
Note that the formula objects of the lm object are different: strt2
does not evaluate the formula. So
2017 Aug 22
4
boot.stepAIC fails with computed formula
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, -3, 3)
x4 <- runif(n, -3, 3)
x5 <- runif(n, -3, 3)
x6 <- runif(n, -3, 3)
x7
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
Consider:
x <- list(`a b` = 1)
x$a<tab>
(i.e., press the 'tab' key after typing 'x$a')
The auto-complete mechanism will fill the buffer like so:
x$a b
This is not particularly helpful because this is now a syntax error.
It seems to me there's a simple fix -- in
utils:::specialCompletions(), we can wrap the result of
utils:::specialOpCompletionsHelper() with
2023 Mar 01
1
tab-complete for non-syntactic names could attempt backtick-wrapping
Great suggestion! I've started a patch:
https://bugs.r-project.org/show_bug.cgi?id=18479
On Wed, Mar 1, 2023 at 1:56 AM Ivan Krylov <krylov.r00t at gmail.com> wrote:
>
> ? Wed, 1 Mar 2023 01:36:02 -0800
> Michael Chirico via R-devel <r-devel at r-project.org> ?????:
>
> > +comps[non_syntactic] <- paste0("`", comps[non_syntactic], "`")
>
2023 Mar 02
3
tab-complete for non-syntactic names could attempt backtick-wrapping
There turn out to be a few more things to fix.
One problem is easy to solve: vapply() needs a third argument
specifying the type of the return value. (Can we have unit tests for
tab completion?)
The other problem is harder: `comps` defaults to an empty string, and
you can't have a symbol consisting of an empty string, because this
value is internally reserved for missing function arguments.
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
Dear R-devel list members,
I've discovered an inconsistency in how lm() and similar functions handle logical predictors as opposed to factor or character predictors. An "lm" object for a model that includes factor or character predictors includes the levels of a factor or unique values of a character predictor in the $xlevels component of the object, but not the FALSE/TRUE values
2010 Apr 13
2
Generating model formulas for all k-way terms
For the vcdExtra package, I'm exploring methods to generate and fit
collections of glm models,
and handling lists of such model objects, of class "glmlist". The
simplest example is fitting all
k-way models, from k=0 (null model) to the model with the highest-order
interaction. I'm
having trouble writing a function, Kway (below) to do what is done in
the example below
>
2002 Mar 08
1
Matrix multiplication problem
Dear List,
I am having trouble with some R code I have written to perform
Redundancy Analysis (RDA) on a matrix of species abundance data (Y) and
a matrix of environmental data (X).
RDA is a constrained form of PCA and can be thought of as a PCA of the
fitted values of a regression of each variable in Y on all variables in
X.
For info, the first use of RDA is in:
Rao, C.R, 1964. The use and
2006 Dec 28
1
split-plot multiple comparisons
Dear R user,
I am new with split-plot designs and I have problems with multiple comparisons.
This data correspond to an split-plot experiment with two replications
(bloque).(Hoshmand, 2006 pp 138). Briefly, the whole-plot factor is
Nitrogen concentration ("nitrogeno") and the subplot factor is the variety
of corn ("hibrido"). The aim is to determine if major differences
2024 Nov 04
2
Invalid term in model formula with gmm after formula.tools is loaded
? Sun, 3 Nov 2024 12:53:52 +0100
Elys?e Aristide <ariel92and at gmail.com> ?????:
> Does that mean that I should send a new message? Or is it okay for
> this time?
No need to post it again. Did it help to replace the as.character()
method for formulas provided by 'formula.tools'? I see the problem is
already reported to the 'formula.tools' maintainer [*], so there
2013 Feb 04
2
Contract Syntactic Sugar
## the following is a dream: add some sugar syntax to allow for
contracts with teeth (in and out checking)
> is.positive <- function(x) (all(x>0))
> exponentiate <- function( x ::is.data.frame , exponent ::is.numeric is.positive) :: is.vector is.numeric {
x$base :: is.positive ## error also if base does not exist
in x; may need some special IQ
x$base^exponent
}
2017 Aug 23
0
boot.stepAIC fails with computed formula
It seems that if you build the formula as a character string, and
postpone the "as.formula" into the lm call, it works.
instead of
frm1 <- as.formula(paste(trg,"~1"))
use
frm1a <- paste(trg,"~1")
and then
strt <- lm(as.formula(frm1a),dat)
regards,
Heinz
Stephen O'hagan wrote/hat geschrieben on/am 23.08.2017 12:07:
> Until I get a fix that works, a