Dear List,
Several times I use this package I get the error message shown below.
When I work out simple examples, it turns out to be fine, but when
working with real and moderate size data sets I always get the same
error.
Do you know what could be the cause of the problem?
Error in apply(mod.matrix[, components], 1, prod) :
subscript out of bounds
Error in plot(effect("myvariable", glm.sev1)) :
error in evaluating the argument 'x' in selecting a method for
function 'plot'
Thanks,
Lars/
Dear Lars, There's not nearly enough information here to know what's wrong. I can guess (but shouldn't have to) that the model glm.sev1 is a generalized linear model of some sort, probably fit by glm(). At a minimum, it would help to know what command you used to fit the model, the history of commands leading to the error, and version and session information. Ideally you'd include a reproducible example. The size of the data set should be irrelevant to this error, so if you could supply the information I requested, along with a small subset of your data on which the model can be fit, I can try to figure out what's wrong. Best, John -------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] > On Behalf Of Lars Bishop > Sent: July-30-11 3:01 PM > To: r-help at r-project.org > Subject: [R] Problem with effects package > > Dear List, > > Several times I use this package I get the error message shown below. > When I work out simple examples, it turns out to be fine, but when > working with real and moderate size data sets I always get the same > error. > > Do you know what could be the cause of the problem? > > > Error in apply(mod.matrix[, components], 1, prod) : > subscript out of bounds > Error in plot(effect("myvariable", glm.sev1)) : > error in evaluating the argument 'x' in selecting a method for > function 'plot' > > Thanks, > Lars/ > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
Not with a description like that.
You need to make a reproducible example. Try using head () or subset to make a
smaller data set. Provide the data (using e.g. dput()). Provide the commands
that trigger the errors. Who knows... you might even see the issue yourself
then.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil@dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Lars Bishop <lars52r@gmail.com> wrote:
Dear List,
Several times I use this package I get the error message shown below.
When I work out simple examples, it turns out to be fine, but when
working with real and moderate size data sets I always get the same
error.
Do you know what could be the cause of the problem?
Error in apply(mod.matrix[, components], 1, prod) :
subscript out of bounds
Error in plot(effect("myvariable", glm.sev1)) :
error in evaluating the argument 'x' in selecting a method for
function 'plot'
Thanks,
Lars/
_____________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
ok. Here's an example:
R version 2.11.1
effects_2.0-10
var1 <- c(25631.9392, 2521.2590, 6656.6516, 1362.5997, 6369.9818,
27253.4223, 2073.1909, 9959.3792,
3318.2500, 15323.8103, 11583.8717, 3054.5558, 625.6597,
2500.0000, 11996.2271)
var2 <- as.factor(c("B:=500", "B:=500",
"B:=500", "B:=500", "B:=500",
"B:=500", "B:=500", "B:=500",
"B:=500", "C:750-1000",
"C:750-1000", "B:=500",
"B:=500", "B:=500", "B:=500"))
glm1 <- glm(var1 ~ var2, family = Gamma(link = "log"))
summary(glm1)
library(effects)
plot(effect("var2", glm1))
Error in apply(mod.matrix[, components], 1, prod) :
subscript out of bounds
Error in plot(effect("var2", glm1)) :
error in evaluating the argument 'x' in selecting a method for
function 'plot'>
On Sat, Jul 30, 2011 at 3:10 PM, jim holtman <jholtman at gmail.com>
wrote:> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> We can not help unless we at least have the data that you are using.
>
> On Sat, Jul 30, 2011 at 3:01 PM, Lars Bishop <lars52r at gmail.com>
wrote:
>> Dear List,
>>
>> Several times I use this package I get the error message shown below.
>> When I work out simple examples, it turns out to be fine, but when
>> working with real and moderate size data sets I always get the same
>> error.
>>
>> Do you know what could be the cause of the problem?
>>
>>
>> Error in apply(mod.matrix[, components], 1, prod) :
>> ?subscript out of bounds
>> Error in plot(effect("myvariable", glm.sev1)) :
>> ?error in evaluating the argument 'x' in selecting a method for
>> function 'plot'
>>
>> Thanks,
>> Lars/
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
>