[R-sig-ME] HGLM object parameters

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Thu Mar 2 03:28:35 CET 2023


On 2023-03-01 9:20 p.m., J.D. Haltigan wrote:
> So in this case, if I want to extract the p > t value from the 
> returned object, I would need to create a separate object that pulls 
> the summary list from the object? I usually just run the code for 
> summary to inspect the values in the data editor, rather than using it 
> to create a 2nd'ary object.


   You don't have to save the summary object, you can construct it and 
extract what you need on the fly. Continuing the example:


   get_p_values <- function(m) {

     summary(m)$FixCoefMat[,"Pr(>|t|)"]

}


get_p_values(m11)

  (Intercept)           x1           x3           x5           x6
3.009494e-53 2.627136e-03 9.343313e-06 1.185092e-02 1.796667e-06

>
> When I inspect the object manually from within R, for the fixef list, 
> there are only the intercept + B estimates that I see. What I am doing 
> is creating a custom function where I need to pull that value for 
> another dataframe, so it was not immediately clear to me if I could 
> pull that value directly from the returned object which doesn't seem 
> to include it.
>
> On Wed, Mar 1, 2023 at 9:09 PM Ben Bolker <bbolker using gmail.com> wrote:
>
>     If this is hglm::hglm(), then Jeff is right.  From the examples:
>
>
>     library(hglm)
>
>     data(semiconductor)
>     m11 <- hglm(fixed = y ~ x1 + x3 + x5 + x6,
>                       random = ~ 1|Device,
>                       family = Gamma(link = log),
>                       disp = ~ x2 + x3, data = semiconductor)
>
>     s <- summary(m11)
>
>     s$FixCoefMat
>                    Estimate Std. Error    t-value     Pr(>|t|)
>     (Intercept) -4.7116845 0.06695731 -70.368491 3.009494e-53
>     x1           0.2097871 0.06638132   3.160333 2.627136e-03
>     x3           0.3289347 0.06695731   4.912604 9.343313e-06
>     x5          -0.1731428 0.06638132  -2.608306 1.185092e-02
>     x6          -0.3569009 0.06633464  -5.380311 1.796667e-06
>
>        If this is a different HGLM package you'll have to specify ...
>
>     On 2023-03-01 8:58 p.m., Jeff Newmiller wrote:
>     > No idea in this specific case, but normally such information is
>     stored in the object you get back from the summary function when
>     you give it the HGLM model object. Look at ?summary.HGLM.
>     >
>     > On March 1, 2023 5:48:56 PM PST, "J.D. Haltigan"
>     <jhaltiga using gmail.com> wrote:
>     >> Sent this request for information to the listed maintainer of
>     the package,
>     >> but have not heard back and was wondering if anyone else might
>     be able to
>     >> confirm:
>     >>
>     >> In the returned class object of HGLM, is the pr > t value
>     stored anywhere
>     >> in the fixed effect list of values? I don't see it, but perhaps
>     I am
>     >> missing its location elsewhere in the returned object.
>     >>
>     >> Thanks in advance for any insight.
>     >>
>     >>      [[alternative HTML version deleted]]
>     >>
>     >> _______________________________________________
>     >> R-sig-mixed-models using r-project.org mailing list
>     >> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>
>     _______________________________________________
>     R-sig-mixed-models using r-project.org mailing list
>     https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



More information about the R-sig-mixed-models mailing list