Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8185515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:52:28+00:00 2026-06-07T01:52:28+00:00

I get the following error messgae in R when I try to use allEffects()

  • 0

I get the following error messgae in R when I try to use allEffects() from the effects-package on a GLMM (mpc7j) created with glmer() from lme4:

> mpc7j<- glmer(correct_response ~ pc * Stim.cond + sess:pc + sess:Stim.cond +
                (1|item.no) + (1|id), data=d7nowl, family=binomial)

> allEffects(mpc7j)
Error in eval(expr, envir, enclos) : Object 'sess' not found

When I use allEffects() on a different model (“dummy”) on the same data without a term including “sess” in the fixed effects, it works just fine.

> dummy<- glmer(correct_response ~ pc * Stim.cond + (1|item.no) + (1|id),
                data=d7nowl, family=binomial)

I used str(mpc7j) to check my model and it looks like “sess” is in there as factor in the group of contrast treatments.

.. .. ..$ pc       : chr "contr.treatment"
.. .. ..$ Stim.cond: chr "contr.treatment"
.. .. ..$ sess     : chr "contr.treatment"

“sess” is a factor with 2 levels and refers to the time of testing (repeated measures, session1 and session2). One of the subjects I tested was tested only once, not twice like all the other subjects. Could that have anything to do with the error?

I would appreciate any pointers as to what I am doing wrong here or where I should look for a solution. I already googled the error message without success. The R documentation on the allEffects() function did not help me either. Help, please?

EDIT: When I try to use plotLMER.fnc() from languageR, I get this error:

> plotmpc7j<-plotLMER.fnc(mpc7j)
log odds are back-transformed to probabilities
Fehler: Indizierung außerhalb der Grenzen

The last line translates to something like “error: Indices outside bounds”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T01:52:29+00:00Added an answer on June 7, 2026 at 1:52 am

    Even though this is incomplete, I’m posting it as an answer rather than as a comment because it’s long and contains a lot of code … (I can go back and delete it later …

    The bottom line, so far, is that this is not a glmer/GLMM-specific problem, but a problem with a model that includes interaction terms (in this case sess:pc and sess:Stim.cond) without the main effects (sess) (in general such models are odd and often, but not always, wrong … which may be why they’re not handled by the effects package). I would consider contacting the package maintainers (maintainer("effects")) …

    Create a dummy data set with the correct structure:

    d7nowl <- expand.grid(pc=factor(LETTERS[1:2]),
                          Stim.cond=factor(letters[1:2]),
                          sess=factor(1:2),
                          item.no=factor(1:10),id=factor(1:10))
    d7nowl$correct_response <- rbinom(nrow(d7nowl),size=1,prob=0.5)
    

    Fit the GLMM:

    g1 <- glmer(correct_response ~ pc * Stim.cond + sess:pc + sess:Stim.cond +
                (1|item.no) + (1|id), data=d7nowl, family=binomial)
    
    ## reproduce error
    try(allEffects(g1)) 
    ## Error in eval(expr, envir, enclos) : object 'sess' not found
    

    Now try a similar model with a GLM.

    g2 <- glm(correct_response ~ pc * Stim.cond + sess:pc + sess:Stim.cond,
                data=d7nowl, family=binomial)    
    try(allEffects(g2)) ## same error
    

    allEffects gives us an answer (I haven’t checked to see if it makes sense) if we either add the main effect of sess or (as pointed out in the original question) take out the interactions with sess.

    g3 <- update(g2,.~.+sess)
    try(allEffects(g3)) ## OK
    
    g4 <- update(g2,.~.-sess:pc-sess:Stim.cond)
    try(allEffects(g4)) ## OK
    

    If I try to simplify still further allEffects still breaks, but with a different error message:

    g5 <- glm(correct_response ~ pc + sess:pc, data=d7nowl, family=binomial)
    try(allEffects(g5))
    ## Error in mod.matrix[, components] : subscript out of bounds
    

    Understanding exactly what’s going wrong will require digging into the guts of effects:::analyze.model (an internal utility function) to see where the logic goes wrong.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get following error message, when I try to run git rebase -i for
I get the following error message when I try the following: Dim XL As
I get a message saying the following: Error 1 Package restore is disabled by
I get the following error message when I try this query: $query .= ($tid,
I receive the following error message when I try to use the sphinx-quickstart generated
I get the above error whenever I try and use ActionLink ? I've only
I get the following error message when I try to start the Git GUI:
when I start GDB, I get the following error message in debugger: input:--- token
Upon launching a sinatra app, I get the following error message: /home/matt/.rvm/gems/ruby-1.9.3-p125/gems/backports-2.5.1/lib/backports/tools.rb:310:in `require': cannot
When I'm uploading a module to Hackage, I get the following error message: Exposed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.