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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:51:16+00:00 2026-06-06T17:51:16+00:00

I’m trying to compute confidence intervals for groups with a common model using lmList

  • 0

I’m trying to compute confidence intervals for groups with a common model using lmList from the lme4 package. It works fine for normal linear model, but fails when the dependent variable is dichotomous. For example, this works fine:

d <- data.frame(
  g = sample(c("A","B","C","D","E"), 250, replace=TRUE),
  y1 = runif(250, max=100),
  y2 = sample(c(0,1), 250, replace=TRUE)
)

library(lme4)

fm1 <- lmList(y1 ~ 1 | g, data=d)

I can extract the coefficients using coef(fm1) and the confidence interval for the coefficients using confint(fm1). Then I run a model with the dichotomous outcome:

fm2 <- lmList(y2 ~ 1 | g, data=d, family=binomial)

I can still get the coefficients using coef(fm2), but when I try to get the confidence intervals, I get an error:

> confint(fm2)
Waiting for profiling to be done...
Waiting for profiling to be done...
Error in val[, , i] <- eval(mCall) : incorrect number of subscripts

I was originally going to post this to stats.stackexchange because I thought it might be something I don’t understand about the confidence intervals of GLMs, but then I figured out that I can still get the confidence intervals using

by(d, d$g, function(x) confint(glm(y2 ~ 1, data=x, family=binomial))) 

Is there some way to do this using lmList?

> sessionInfo()
R version 2.15.0 (2012-03-30)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252  
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                  
[5] LC_TIME=German_Germany.1252   

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

other attached packages:
[1] lme4_0.999375-42 Matrix_1.0-6     lattice_0.20-6 

loaded via a namespace (and not attached):
[1] grid_2.15.0   MASS_7.3-17   nlme_3.1-103  stats4_2.15.0 tools_2.15.0 
  • 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-06T17:51:18+00:00Added an answer on June 6, 2026 at 5:51 pm

    It is indeed a bug, I’m working on a fix. It turns out to be fairly straightforward: the basic problem is that confint.lm returns a matrix while confint.glm returns a data frame.

    In general I strongly recommend posting all but the most trivial bug fixes to the bug tracker at http://r-forge.r-project.org/tracker/?atid=298&group_id=60&func=browse (I complain about R-core’s attitude toward bug reports, so for consistency I have to follow my own rules …) Thanks for the report!

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.