Likelihood-based inference

metaGLMM authors

Fit a model

This example uses the same aggregate-data contract for a small Gaussian random-effects model.

dat <- data.frame(
  study = paste0("Study ", 1:8),
  estimate = c(-0.80, -0.30, 0.10, 0.70, 1.10, -0.50, 0.40, 1.30),
  moderator = c(0, 1, 0, 1, 0, 1, 0, 1),
  vi = c(0.04, 0.05, 0.03, 0.06, 0.04, 0.05, 0.03, 0.05),
  ni = c(100, 90, 120, 80, 110, 95, 130, 85)
)

fit <- metaGLMM(
  estimate ~ moderator,
  data = dat,
  vi = dat$vi,
  ni = dat$ni,
  tau2 = NA,
  tau2_var = TRUE,
  family = gaussian(link = "identity"),
  fast = TRUE
)
summary(fit)
#> Aggregate-data generalized linear mixed-effects meta-analysis
#> 
#> Call:
#> metaGLMM(formula = estimate ~ moderator, data = dat, vi = dat$vi, 
#>     ni = dat$ni, tau2 = NA, family = gaussian(link = "identity"), 
#>     tau2_var = TRUE, fast = TRUE)
#> 
#> Family:gaussian(identity)
#> Random-effect structure: row_intercept 
#> Integration: closed_form 
#> 
#> Fixed effects:
#>             Estimate Std. Error z value Pr(>|z|)
#> (Intercept)  0.20051    0.34997   0.573    0.567
#> moderator    0.09754    0.49933   0.195    0.845
#> 
#> Heterogeneity:
#>   tau^2: 0.455 
#>   tau:   0.6745 
#> 
#> Fit diagnostics:
#>   Optimizer: L-BFGS-B 
#>   Convergence code: 0 
#>   Boundary tau^2: no 
#>   Positive-definite Hessian: yes

Wald intervals

The default interval is based on the fixed-effect estimate and its covariance matrix. Specify a coefficient with parm or request all fixed effects.

confint(fit, method = "wald")
#>                  lower     upper
#> (Intercept) -0.4854108 0.8864311
#> moderator   -0.8811343 1.0762113
confint(fit, parm = "moderator", level = 0.90, method = "wald")
#>                lower     upper
#> moderator -0.7237896 0.9188666

Profile and SBC intervals

The official confint() interface accepts three method names: "wald", "profile", and "SBC". Names are case-insensitive and intervals target fixed effects. Profile evaluation re-optimizes the nuisance parameters at each fixed-effect value; SBC applies the simple small-sample correction to the profile cutoff.

profile_ci <- confint(fit, parm = "moderator",
                      method = "profile", level = 0.95)
profile_ci

sbc_ci <- confint(fit, parm = "moderator",
                  method = "SBC", level = 0.95)
sbc_ci

The profile and SBC calculations are more expensive than Wald intervals. For a larger analysis, use a fixed QMC sequence and record the optimizer settings along with the fitted object.

Inspecting the likelihood fit

The standard methods keep the fixed-effect interface separate from heterogeneity parameters.

coef(fit)
#> (Intercept)   moderator 
#>  0.20051015  0.09753851
vcov(fit)
#>             (Intercept)  moderator
#> (Intercept)   0.1224763 -0.1224765
#> moderator    -0.1224765  0.2493325
logLik(fit)
#> 'log Lik.' -1.231958 (df=3)
nobs(fit)
#> [1] 8
fit$tau2
#> [1] 0.4549558
fit$tau
#> [1] 0.6745041
stopifnot(is.finite(fit$tau), fit$tau > 0)

A method value outside the three documented choices is rejected rather than silently selecting a different interval procedure. The legacy ci_metaGLMM() and low-level profile helpers remain available for existing scripts, but new code should use confint().

mirror server hosted at Truenetwork, Russian Federation.