Learn R Programming

ebdm (version 3.0.0)

est_mixture: Estimate Parameters in a Two-Component Gaussian Mixture Using Study-Level Summaries

Description

Estimates group-specific means and standard deviations \((\mu_1, \mu_0, \sigma_1, \sigma_0)\) in a two-component normal mixture model based on aggregate data across multiple studies. The continuous variable \(X\) is assumed to follow a Gaussian mixture conditional on a binary group indicator \(Y \in \{0,1\}\), with each study reporting only summary-level statistics.

Usage

est_mixture(ni, xbar, mi, s2 = NULL, method = c("gmm", "naive"))

Value

A named list containing:

mu1_hat, mu0_hat

Estimated means of the two groups.

sigma1_hat, sigma0_hat

Estimated standard deviations.

se

Standard errors of the parameter estimates (NA if method = "naive").

ci

List of 95% confidence intervals for each parameter (NULL if method = "naive").

method

A character string indicating the method used.

Arguments

ni

Integer vector of sample sizes per study.

xbar

Numeric vector of sample means per study.

mi

Integer vector of group 1 counts per study.

s2

Numeric vector of sample variances per study. Required if method = "gmm".

method

Estimation method to use. One of "naive" or "gmm". Default is "gmm".

Details

#' Two estimation methods are available:

  • "naive": Likelihood-based estimator using only sample means.

  • "gmm": Generalized method of moments (GMM) estimator using sample means and variances.

Examples

Run this code
# Load example dataset included in the package
data(mixture_example)

# Estimate using GMM (recommended) with full summary statistics
est_mixture(
  ni = mixture_example$ni,
  xbar = mixture_example$xbar,
  s2 = mixture_example$s2,
  mi = mixture_example$mi,
  method = "gmm"
)

# Estimate using naive likelihood method (only means used)
est_mixture(
  ni = mixture_example$ni,
  xbar = mixture_example$xbar,
  mi = mixture_example$mi,
  method = "naive"
)

Run the code above in your browser using DataLab