test.asaRLRT: Asymptotic-approximate RLRT for variance components in GLMMs

Description Usage Arguments Details Value See Also Examples

Description

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).

Usage

1
test.asaRLRT(fit.glmmPQL, nsim = 10000)

Arguments

fit.glmmPQL

Alternative model estimated using the glmmPQL.mod function.

Details

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.

Value

Returns a list of testing results:

See Also

test.aRLRT

Examples

 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)

stchen3/glmmVCtest documentation built on May 23, 2019, 2:48 p.m.