Learn R Programming

ProfileGLMM (version 1.1.0)

profileGLMM_postProcess: Post-process MCMC Output for Profile GLMM

Description

This function performs essential post-processing of the MCMC output generated by profileGLMM_Gibbs. It calculates posterior means and credible intervals for fixed effects and, optionally, computes a representative cluster partition using Least Squares (LS) or Ng's spectral clustering (NG). It also estimates cluster characteristics such as centroids, probability vectors, and outcome effects for the chosen partition.

Usage

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

Value

An object of class pglmm_fit. This is a list containing:

  • coocMat: The co-occurrence matrix of MCMC cluster assignments.

  • clust: A list of representative clustering results (if comp_cooc = TRUE), including the optimal partition (Zstar), number of clusters (Kstar), and cluster-specific parameters (cen, pvec, gamma).

  • pop: A list containing the posterior means and credible intervals for fixed effects.

Arguments

MCMC_Obj

An object of class pglmm_mcmc (the output of profileGLMM_Gibbs).

modeClus

A character string specifying the clustering method. 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. If FALSE, only the population parameters are processed.

alpha

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

Examples

Run this code
# Load MCMC_Obj, the result of profileGLMM_Gibbs()
data("examp")
MCMC_Obj = examp$MCMC_Obj

# Post-process the results
post_Obj = profileGLMM_postProcess(MCMC_Obj, modeClus='LS')

# Removing the cooc matrix to save space
post_Obj$coocMat = NULL

Run the code above in your browser using DataLab