I recently came across a situation in the context of a meta-analysis where a model coefficient is just estimated by a single observation. Consider the following example:
library(metafor)
dat <- dat.bcg
dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat, subset=-5)
res <- rma(yi, vi, data=dat, mods = ~ 0 + alloc)
res
The coefficient for allocalternate is just the observed effect for this level (i.e., dat[5,]). As a result, when using the sandwich method, the variance for this coefficient is equal to zero:
I recently came across a situation in the context of a meta-analysis where a model coefficient is just estimated by a single observation. Consider the following example:
The coefficient for
allocalternate
is just the observed effect for this level (i.e.,dat[5,]
). As a result, when using the sandwich method, the variance for this coefficient is equal to zero:Both
coef_test()
andconf_int()
run and giveNaN
/NA
where applicable:But
Wald_test()
craps out:Obviously, it can't actually run the test, but it might be nice if it handles this edge case a bit more gracefully.