Code Monkey home page Code Monkey logo

Comments (5)

alexanderrobitzsch avatar alexanderrobitzsch commented on June 17, 2024

from miceadds.

tra6sdc avatar tra6sdc commented on June 17, 2024

Hi, do I need to post this bug to the multiwayvcov R package? I also note that I get the error even when there are no NA parameter estimates.

> library(miceadds)
> df<-structure(list(Zone = structure(c(1L, 2L, 1L, 1L, 1L, 2L, 2L,  +
3L, 3L), .Label = c("A", "B", "C"), class = "factor"), Y = c(2L,  + 
3L, 5L, 4L, 3L, 5L, 7L, 8L, 10L), Cat1 = structure(c(1L, 1L,  + 
1L, 1L, 1L, 2L, 2L, 2L, 2L), .Label = c("Fact1", "Fact2"), class = "factor"),  +  
Cat2 = structure(c(1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L), .Label = c("Level1",  + 
"Level2", "Level3"), class = "factor")), class = "data.frame", row.names = c(NA,-9L))

> Fitglm<-glm(Y~Cat1+Cat2,df,family="gaussian")
summary(Fitglm)
Call: glm(formula = Y ~ Cat1 + Cat2, family = "gaussian", data = df)
Deviance Residuals:        1        2        3        4        5        6        7        8        9
-0.5000   0.5000   1.0000   0.0000  -1.0000   0.0000  -1.3333  -0.3333   1.6667
Coefficients:
         Estimate Std. Error t value Pr(>\|t\|)
(Intercept)   2.5000     0.8466   2.953   0.0318 * 
Cat1Fact2     1.0000     1.3824   0.723   0.5019
Cat2Level2    1.5000     1.0929   1.372   0.2283
Cat2Level3    4.8333     1.7623   2.743   0.0407 *
--- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for gaussian family taken to be 1.433333)
 Null deviance: 55.5556  on 8  degrees of freedom
 Residual deviance:  7.1667  on 5  degrees of freedom AIC: 33.491
 Number of Fisher Scoring iteraations 2

> Fitglm.cluster<-glm.cluster(df,Y~Cat1+Cat2,cluster="Zone",family="gaussian") 
> summary(Fitglm.cluster)
Error in `[<-`(`*tmp*`, , "z value", value = csmod[, "Estimate"]/csmod[,  :
  subscript out of bounds 
> length(Fitglm.cluster$glm_res$coefficients) [1] 4 
> Fitglm.cluster$glm_res$coefficients 
(Intercept)   Cat1Fact2  Cat2Level2  Cat2Level3 
2.500000    1.000000    1.500000    4.833333
> length(Fitglm.cluster$vcov) [1] 16
> Fitglm.cluster$vcov
            (Intercept)     Cat1Fact2    Cat2Level2    Cat2Level3
(Intercept)  3.000000e-01  1.973730e-16 -3.000000e-01 -5.666667e-01
Cat1Fact2    7.012097e-31  7.012097e-31 -1.402419e-30 -4.715021e-16
Cat2Level2  -3.000000e-01 -1.973730e-16  3.000000e-01  5.666667e-01
Cat2Level3  -5.666667e-01 -7.894919e-16  5.666667e-01  1.781481e+00

from miceadds.

alexanderrobitzsch avatar alexanderrobitzsch commented on June 17, 2024

I replicated your bug. You were indeed right. The summary.glm.cluster produced a bug. I fixed the bug in miceadds 3.0-3.

from miceadds.

tra6sdc avatar tra6sdc commented on June 17, 2024

from miceadds.

alexanderrobitzsch avatar alexanderrobitzsch commented on June 17, 2024

Yes, this was the reason. I did not expect a change of labeling in summary.glm.

from miceadds.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.