Package 'GLMMselect'

Title: Bayesian Model Selection for Generalized Linear Mixed Models
Description: A Bayesian model selection approach for generalized linear mixed models. Currently, 'GLMMselect' can be used for Poisson GLMM and Bernoulli GLMM. 'GLMMselect' can select fixed effects and random effects simultaneously. Covariance structures for the random effects are a product of a unknown scalar and a known semi-positive definite matrix. 'GLMMselect' can be widely used in areas such as longitudinal studies, genome-wide association studies, and spatial statistics. 'GLMMselect' is based on Xu, Ferreira, Porter, and Franck (202X), Bayesian Model Selection Method for Generalized Linear Mixed Models, Biometrics, under review.
Authors: Shuangshuang Xu [aut, cre], Marco Ferreira [aut] , Erica Porter [aut], Christopher Franck [aut]
Maintainer: Shuangshuang Xu <[email protected]>
License: GPL-3
Version: 1.2.0
Built: 2025-02-12 04:10:38 UTC
Source: https://github.com/cran/GLMMselect

Help Index


GLMMselect: Bayesian model selection method for generalized linear mixed models

Description

GLMMselect: Bayesian model selection method for generalized linear mixed models

Usage

GLMMselect(
  Y,
  X,
  Sigma,
  Z,
  family,
  prior,
  offset = NULL,
  NumofModel = 10,
  pip_fixed = 0.5,
  pip_random = 0.5
)

Arguments

Y

A numeric vector of observations.

X

A matrix of covariates.

Sigma

A list of covariance matrices for random effects.

Z

A list of design matrices for random effects.

family

A description of the error distribution to be used in the model.

prior

The prior distribution for variance component of random effects.

offset

This can be used to specify an a priori known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of observations.

NumofModel

The number of models with the largest posterior probabilities being printed out.

pip_fixed

The cutoff that if the posterior inclusion probability of fixed effects is larger than it, the fixed effects will be included in the best model.

pip_random

The cutoff that if the posterior inclusion probability of random effects is larger than it, the random effects will be included in the best model.

Value

A list of the indices of covariates and random effects which are in the best model.

Examples

library(GLMMselect)

data("Y");data("X");data("Z");data("Sigma")
Model_selection_output <- GLMMselect(Y=Y, X=X, Sigma=Sigma,
                         Z=Z, family="poisson", prior="AR", offset=NULL)

The vector of priori information for lip cancer case study

Description

The expected number of lip cancer cases in each Scotland county between 1975 and 1980.

Usage

lipcancer_offset

Format

lipcancer_offset

A vector


A list of covariance matrices

Description

This is a list of two covariance matrices for two types of random effects. The first component is for spatial random effects. The second componet is for overdispersion random effects.

Usage

lipcancer_Sigma

Format

lipcancer_Sigma

A list of covariance matrices for random effects.


The matrix of candidate covariates

Description

This is a matrix with one candidate covariates, which is the proportion of population engaged in agriculture, fishing, or forestry.

Usage

lipcancer_X

Format

lipcancer_X

A matrix with 56 observations and 1 covariate.


The vector of observations for lip cancer case study

Description

The observations about the observed number of lip cancer cases in each Scotland county between 1975 and 1980.

Usage

lipcancer_Y

Format

lipcancer_Y

A vector with 56 observations.


A list of design matrices

Description

This is a list of two design matrices for two types of random effects. The first component is for spatial random effects. The second componet is for overdispersion random effects.

Usage

lipcancer_Z

Format

lipcancer_Z

A list of design matrices for random effects.


A list of covariance matrices

Description

This is a list of two covariance matrices for two types of random effects. The first component is for spatial random effects. The second componet is for overdispersion random effects.

Usage

Sigma

Format

Sigma

A list of covariance matrices for random effects.


The matrix of candidate covariates

Description

This is a matrix with four candidate covariates. The covariates in the first two columns are in the true model.

Usage

X

Format

X

A matrix with 100 observations and 4 covariates.


The vector of observations

Description

The data was simulated under a Poisson Generalized linear mixed model with four candidate covariates, a vector of spatial random effects, and a vector of overdispersion random effects. The matrix of candidate covariates, the design matrices for two types of random effects, and the covariance matrices for two types of random effects are provide in the package.

Usage

Y

Format

Y

A vector with 100 observations.


A list of design matrices

Description

This is a list of two design matrices for two types of random effects. The first component is for spatial random effects. The second componet is for overdispersion random effects.

Usage

Z

Format

Z

A list of design matrices for random effects.