Description Usage Arguments Details Value See Also Examples
Conducts an asymptotic-approximate restricted-likelihood ratio test (as-aRLRT) for random effects (variance components) in generalized linear mixed models (GLMMs). The method applies RLRT to the working linear mixed model (LMM) approximation for the GLMM used in PQL estimation. The test statistic is compared to the asymptotic null distribution from Self and Liang (1987).
1 | test.asaRLRT(fit.glmmPQL, nsim = 10000)
|
fit.glmmPQL |
Alternative model estimated using the |
Compared to the recommended aRLRT, this method instead uses an asymptotic null
distribution (Self and Liang 1987), which typically has conservative type I error
rates and lower power. The function assumes that the first specified random effect is
the factor of interest.
This random effect must be independent of all other random effects, but can have any
covariance structure.
Please use the glmmPQL.mod
function in this package; it has minor modifications
from MASS::glmmPQL
.
NOTE: The glmmPQL model cannot use the ~(1|group) notation
for any random effects (fixed are ok). Please specify a random interept directly
by adding an intercept column (column of 1s) and using ~(0+'name'|group). Variable name
does not matter.
The function does not currently support simultaneous testing of fixed and random effects. That may be added in the future.
Returns a list of testing results:
asaRLRT
: outcome of the asaRLRT test (statistic and p-value)
std.data
: data.frame of standardized normalized responses (Ytilde),
fixed effects design, and random effects design
fit.alt
: lme under the alternative hypothesis
fit.null
: lme under the null hypothesis
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
library(glmm)
data(salamander) # load data
salamander$int <- 1 # add column of 1s for random intercept
# Fit alternative hypothesis
glmm.fit <- glmmPQL.mod(Mate~0+Cross, random=list(~0+int|Male),
data=salamander, family=binomial, weights=rep(1,nrow(salamander)))
# Test significance of random subject-specific intercept for Male salamanders
asaRLRT <- test.asaRLRT(glmm.fit)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.