Skip to content

R freezes when trying to extract marginal means from a GAMLSS fit #26

Description

@robpetrosino

I fit my data (~105,000 observations) to the following GAMLSS model:

exp1_fit_gaml <- gamlss(RT ~ frequency*primetype + 
                        re(random = ~1|subj) +  re(random = ~1|target),
                        nu.formula = ~ frequency*primetype + 
                        re(random = ~1|subj) +  re(random = ~1|target),
                        data=exp1_data_bay, family = exGAUS(),
                        control = gamlss.control(n.cyc = 50))

The line above runs perfectly and the estimates seem to make sense. However, when I try to extract the marginal means through either emmeans or marginaleffects, R freezes and the only thing I can do is to terminate the session and restart. Here's the code:

#emmeans
library(emmeans)
mu <- emmeans( exp1_fit_gaml, ~frequency*primetype, what = 'mu')

# marginal effects
library(marginaleffects)
grid <- datagrid(model=exp1_fit_gaml, by=c("frequency", "primetype"))
mu <- predictions(exp1_fit_gaml, newdata=grid, what='mu')

Can you help figure this out? Both packages should support gamlss, but there seems to be an issue here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions