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 8693809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:37:43+00:00 2026-06-13T00:37:43+00:00

I am using the effects package to construct some probability graphs showing the predicted

  • 0

I am using the effects package to construct some probability graphs showing the predicted probabilities from a logistic regression model.However, I get an odd error message and don’t know what the issue is.

When I attempt to generate the plots, I get the following error. The warning is not an issue, it’s that I’m not understanding what the error message is telling me.

library(effects)    

dat$won_ping = as.factor(dat$won_ping)

mod2 = glm(won_ping ~ our_bid +
  age_of_oldest_driver2 + 
  credit_type2 + 
  coverage_type2 +
  home_owner2 +
  vehicle_driver_score + 
  currently_insured2 +
  zipcode2,
  data=dat, family=binomial(link="logit"))

> plot(effect("our_bid*vehicle_driver_score", mod2), rescale.axis=FALSE, multiline=TRUE)
Warning message:
In analyze.model(term, mod, xlevels, default.levels) :
  our_bid:vehicle_driver_score does not appear in the model
Error in plot(effect("our_bid*vehicle_driver_score", mod2), rescale.axis = FALSE,  : 
  error in evaluating the argument 'x' in selecting a method for function 'plot': Error in apply(mod.matrix[, components], 1, prod) : 
  subscript out of bounds

Here’s info on my data and my glm commands:

> str(dat)
'data.frame':   85240 obs. of  71 variables:
 $ our_bid                     : num  155 123 183 98 108 159 98 123 98 200 ...
 $ won_ping                    : Factor w/ 2 levels "0","1": 1 1 2 1 1 1 1 1 1 1 ...
 $ zipcode2                    : Factor w/ 4 levels "1:6999","10000:14849",..: 4 3 2 1 3 2 3 1 2 2 ...
 $ age_of_oldest_driver2       : Factor w/ 4 levels "18 to 21","22 to 25",..: NA 3 NA NA NA NA 3 NA 3 NA ...
 $ currently_insured2          : Factor w/ 2 levels "0","1": 2 1 2 2 1 1 2 2 1 1 ...
 $ credit_type2                : Ord.factor w/ 4 levels "POOR"<"FAIR"<..: 2 3 2 3 2 2 1 3 3 2 ...
 $ coverage_type2              : Factor w/ 4 levels "BASIC","MINIMUM",..: 4 3 3 3 3 3 3 3 4 3 ...
 $ home_owner2                 : Factor w/ 2 levels "0","1": 1 2 2 2 2 2 2 2 2 2 ...
 $ vehicle_driver_score        : Factor w/ 2 levels "0","1": 1 1 1 1 1 1 1 1 1 1 ...

And finally, here might be some useful info:

> sessionInfo()
R version 2.14.0 (2011-10-31)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] effects_2.2-1    colorspace_1.1-1 nnet_7.3-1       MASS_7.3-16      lattice_0.20-0   foreign_0.8-46  

loaded via a namespace (and not attached):
[1] tools_2.14.0

Help! What is the error message mean? Normally, if a “subscript is out of bounds” that’d mean I’m selecting something outside the bounds of that data structure, but that simply is not occuring.

EDIT:

To @Rowland

As I said above, the warning and error messages are seperate and unrelated. Let’s say I take out zipcode2 and run the glm:

mod2 = glm(won_ping ~ our_bid +
  age_of_oldest_driver2 + 
  credit_type2 + 
  coverage_type2 +
  home_owner2 +
  vehicle_driver_score + 
  currently_insured2,
  data=dat, family=binomial(link="logit"))

> plot(effect("our_bid*home_owner2", mod2), rescale.axis=FALSE, multiline=TRUE)
Warning message:
In analyze.model(term, mod, xlevels, default.levels) :
  our_bid:home_owner2 does not appear in the model

This produces just the warning, which is fine as I get the desired result. So the fact that “:” does not appear in the model is not the issue, and DOES NOT cause the error message.

  • 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-13T00:37:44+00:00Added an answer on June 13, 2026 at 12:37 am

    Try this:

    with(dat, table(our_bid, vehicle_driver_score))
    

    I suspect you have some unpopulated cells. With your edit, it seems unlikely that the sparseness I am hypothesizing as the problem lies with these two variables. It still remains possible that despite your large number of cases that there are still empty cells when the model is constructed with all of those factor variables.

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

Sidebar

Related Questions

Looking to produce some effects using particles bleeding into one another and slowly fading
I was trying to place some simple effects on an image using HBox using
I'm running the following logistic regression model in R and one of the important
LSL (Linden Scripting Language) allows for various particle effects using the llParticleSystem function. What
One of the side-effects of using an external Subversion repository was getting automatic offsite
Using jQuery UI 1.8rc3 combined with the new jquery.effects.fade.js code, I've been able to
I'm using AVAudioPlayer to play sound effects in an iPhone game. This is part
Can anyone explain why using comments like this in css cause really weird effects
How to I hide and show HTML elements using JQuery without any special effects?
I am trying to achieve some effect using imageViews and I need to set

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.