LRT: Likelihood ratio test using a mean-shifted model

View source: R/LRT.r

LRTR Documentation

Likelihood ratio test using a mean-shifted model

Description

Implementing the likelihood ratio tests using the mean-shifted model. The bootstrap p-values are provided.

Usage

LRT(y, v, model="RE", data, B=2000, alpha=0.05, seed=123456)

Arguments

y

A vector of the outcome measure estimates (e.g., MD, SMD, log OR, log RR, RD)

v

A vector of the variance estimate of y

model

A logical value specifying the pooling model (RE: random-effects model, FE: fixed-effect model)

data

An optional data frame containing the variables y and v.

B

The number of bootstrap resampling (default: 2000)

alpha

The significance level (default: 0.05)

seed

A numeric value that determines the random seed for reproducibility (default: 123456).

Value

Results of the likelihood ratio tests involving bootstrap p-values. The outputs are ordered by the p-values.

  • id: ID of the study.

  • LR: The likelihood ratio statistic for based on the mean-shifted model.

  • Q: 1-alphath percentile for the bootstrap distribution of the likelihood ratio statistic.

  • P: The bootstrap p-value for the likelihood ratio statistic.

Examples

require(metafor)
data(SMT)

edat2 <- escalc(m1i=m1,sd1i=s1,n1i=n1,m2i=m2,sd2i=s2,n2i=n2,measure="MD",data=SMT)

LRT(yi, vi, data=edat2, B=10)
# Random-effects model.
# This is an example command for illustration. B should be >= 1000.

LRT(yi, vi, data=edat2, model="FE", B=10)
# Fixed-effect model.
# This is an example command for illustration. B should be >= 1000.

boutliers documentation built on Nov. 26, 2025, 9:06 a.m.