Learn R Programming

ProfileGLMM (version 1.0.2)

profileGLMM_postProcess: Post-process the MCMC chain from profileGLMM_Gibbs

Description

This function performs essential post-processing of the MCMC output generated by the profileGLMM_Gibbs function. It calculates the posterior means and credible intervals for the fixed effects (population parameters) and, optionally, computes a representative cluster partition using methods like Least Squares (LS) or Ng's spectral clustering (NG) on the co-occurrence matrix. It also provides estimated cluster characteristics (centroids, probability vectors, and outcome effects) for the representative partition.

Usage

profileGLMM_postProcess(
  MCMC_Obj,
  modeClus = "NG",
  comp_cooc = TRUE,
  alpha = 0.05
)

Value

A list with three elements:

coocMat:

The co-occurrence matrix of the MCMC cluster assignments (MCMC_Obj$Z).

clust:

A list containing the results of the representative clustering (if comp_cooc = TRUE), including the optimal partition (Zstar), number of clusters (Kstar), representative cluster parameters (cen, pvec, gamma), and full posterior samples for the cluster characteristics.

pop:

A list containing the posterior mean and (1-alpha) credible intervals for the fixed effects (betaFE).

Arguments

MCMC_Obj

Profile GLMM MCMC output of the profileGLMM_Gibbs function. This object must contain the raw MCMC samples for fixed effects (beta), cluster assignments (Z), cluster parameters (pvec, muClus, PhiClus), outcome effects (gamma), and names (names).

modeClus

A character string specifying the clustering method to determine the representative partition. Options are 'NG' (Ng's spectral clustering, default) or 'LS' (Least Squares clustering).

comp_cooc

A logical value. If TRUE (default), the co-occurrence matrix is computed and clustering is performed to find a representative partition. If FALSE, only the population parameters are processed.

alpha

A numeric value between 0 and 1, specifying the significance level for calculating the posterior credible intervals (CIs) of the fixed effects. Defaults to 0.05 (yielding 95% CIs).

Examples

Run this code
# Load MCMC_Obj, the result of profileGLMM_Gibbs()
data("examp")
MCMC_Obj = examp$MCMC_Obj
post_Obj = profileGLMM_postProcess(MCMC_Obj, modeClus='LS')
print(post_Obj$pop$betaFE)

Run the code above in your browser using DataLab