Add sample size-based ML/REML estimators #9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a new
SampleSizeBasedLikelihoodEstimator
class that produces maximum-likelihood random-effects estimates for datasets that have estimates and sample sizes but no variances. This is maybe the modal situation with fMRI data, so it's a nice thing to have.The approach is based on a simple idea in this paper (though I'm sure it's been suggested before in other places), which is to replace the standard log-likelihood function for the random-effects model with an analogous LL based not only beta and tau^2, but also a sigma^2 parameter that's scaled by the (known) inverse sample size. I.e., instead of study estimates being distributed with a variance of
tau^2 + v
(wherev
is the vector of observed sampling variances for the available studies), we assume they're distributed with a variance oftau^2 + sigma^2/n
(wheren
is the vector of known sample sizes, andsigma^2
is an additional parameter estimated from the data).I haven't done any systematic investigation of the performance of this estimator, but the above paper suggests it works reasonably well in many cases, and if nothing else this seems like an improvement over just fitting a GLM to the estimates directly (i.e., ignoring sampling variance/sample size entirely).