GLMMadaptive | GLMMs with adaptive Gaussian quadrature | Development Tools library
kandi X-RAY | GLMMadaptive Summary
kandi X-RAY | GLMMadaptive Summary
GLMMadaptive: Generalized Linear Mixed Models using Adaptive Gaussian Quadrature.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of GLMMadaptive
GLMMadaptive Key Features
GLMMadaptive Examples and Code Snippets
Community Discussions
Trending Discussions on GLMMadaptive
QUESTION
I'm running a hurdle lognormal model using the GLMMadaptive package in R. Both the continuous part as well as the zero-part have categorical variables defined in the fixed effects. I would like to run an ANOVA on these categorical variables to detect if there is a main effect.
I've seen that using the glmmTMB package you are able to separately run an ANOVA on the conditional model and the zero-part model separately, as is demonstrated here.
Is there a similar strategy available for the GLMMadaptive package? (The glmmTMB does not support hurdle lognormal models as far as I understood). Perhaps using the joint_tests
function from the emmeans package? If so, how do you define that you want to test the zero-part model? As emmeans::joint_tests(hurdlemodel)
only gives the F-tests for the conditional part of the model.
Or as an alternative method, could you compare the fit of the models where you exclude the variable of interest against a the full model, as is demonstrated for the relevance of random effects in this vignette?
Many thanks!
The suggestion by Russ Lenth in the comments are implemented below, using the data and model in the GLMMadaptive two-part model vignette:
...ANSWER
Answered 2021-Feb-18 at 20:45The function emmeans::qdrg()
can sometimes be used to create the needed object for a model not directly supported by emmeans. See its documentation. In very simple models (e.g., inheriting from lm
, it may be enough to supply the object
and data
arguments.
That usually does not work for more sophisticated models, in which case
you will need to specify data
, the fixed-effects formula
for the conditional or zero part of the model, and the associated regression coefficients (coef
) and variance-covariance matrix (vcov
) for the part of the model in question. Often with models like this with multiple components, you likely will have to pick a subset of the coefficients and covariance matrix. These all must conform: the length of coef
must equal the number of rows and columns of vcov
and the number of columns in the model matrix generated by formula
[which may be checked via model.matrix(formula, data = data)
].
qdrg()
will not work for a multivariate model -- or at least it's tricky -- because the implied model involves other factor(s) that delineate the levels of the multivariate response. If there are special provisions for, say, spline smoothing, that is another instance where qdrg()
probably can't be made to work.
Once qdrg()
actually runs and produces results, it is a good idea to use it to estimate some contrasts that are estimated by the model parameterization. For example, suppose that the model was fitted with the default contr.treatment
contrasts. Then the regression coefficients are interpretable as a comparison with the first level as a reference level. Accordingly, if we computedrg <- qdrg(...)
, and one of the factors is "treat"
, look at contrast(rg, "trt.vs.ctrl1", simple = "treat")
, and check to see if the first set of estimated contrasts matches the main-effect estimates for treat
.
I will illustrate all of this with a simple lm
model, ignoring the fact that it is already supported by emmeans.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install GLMMadaptive
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page