jepusto / clubSandwich

Cluster-robust (sandwich) variance estimators with small-sample corrections
http://jepusto.github.io/clubSandwich/
47 stars 8 forks source link

coef_test with fixed corelation matrices #64

Closed itchyshin closed 3 years ago

itchyshin commented 3 years ago

Hi @jepusto

In ecology and evolution, meta-analysis often has correlation matrices for a random factor. But I tried coef_test with such a model. Then I get this:

> coef_test(mod4, vcov="CR2", cluster = dat$paper)
Error in vcovCR.rma.mv(obj, type = vcov, ...) : 
  vcovCR.rma.mv() does not work with fixed correlation matrices in the R argument.

Do you think you could make this work with such a model?

Thanks!

jepusto commented 3 years ago

Hi Shinichi, do you mean something like a phylogenetic correlation structure? If so, then the answer is that the theory of RVE doesn't necessarily apply with such structures. The methods implemented in clubSandwich are predicated on having independent clusters of effects. With a phylogenetic correlation structure, such structures aren't necessarily present. There may be generalizations of RVE that apply, but as far as I know, the theory has yet to be worked out here.

On Tue, Mar 23, 2021 at 7:43 PM Shinichi Nakagawa @.***> wrote:

Hi @jepusto https://github.com/jepusto

In ecology and evolution, meta-analysis often has correlation matrices for a random factor. But I tried coef_test with such a model. Then I get this:

coef_test(mod4, vcov="CR2", cluster = dat$paper) Error in vcovCR.rma.mv(obj, type = vcov, ...) : vcovCR.rma.mv() does not work with fixed correlation matrices in the R argument.

Do you think you could make this work with such a model?

Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jepusto/clubSandwich/issues/64, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCVGITP62ZYYY7HOFTWX73TFEYTPANCNFSM4ZWHT7AA .

itchyshin commented 3 years ago

@jepusto - yes, for example, phylogenetic correlation (or even spatial correlation too). In ecological and evolutionary meta-analyses, these correlations can exist on top of correlations due to originating from the same study. In this recent simulation, Ozan, myself and Wolfgang - we showed this kind of models perform best (https://ecoevorxiv.org/su4zv/). An example of the model looks like this:

mod1 <- rma.mv(yi, vi, random = list( ~ 1 | phy, # phylogeny
                                      ~ 1 | animal,                   # species (non-phylogetic signal)
                                      ~ 1 | Article,                   # paper
                                      ~ 1 | obs),                      # effect size 
               R=list(phy = A), data=dat1)                 # A = phylogenetic correlation matrix

Actually, this model the function robust in metafor works - with cluster = dat1$Article. I imagined the REV could be used at the level Article and obs (somehow)?

jepusto commented 3 years ago

It works as in a numerical result comes out? Or it works in the sense that it is valid? To know whether it is valid, we need to understand whether the phylogenetic structure creates dependence across articles. If it does, then as far as I know RVE formulas (as implemented in robust) are not valid because they assume independence across articles. This would be a question for the R-SIG-meta listserv, where Wolfgang will be able to weigh in. Do you have a reproducible example that uses this phylogenetic structure (or a spatial structure)?

itchyshin commented 3 years ago

Thank you, @jepusto - at the moment, yes, it does give some results but I do not know they are valid as you pointed out.

" whether the phylogenetic structure creates dependence across articles." The model assumes all random effects are independent of each other (normally distributed with 0 and certain sigma^2) so I do not think the phylogenetic structure creates dependence across articles. But I not completely sure about what you are meaning. Could you elaborate on it a bit more?

Meanwhile, I prepare a reproducible example and put it here first? Or should I go straight to R-SIG-meta listserv?

jepusto commented 3 years ago

I'd recommend going straight to R-SIG-meta.

With phylogenetic structures, my understanding is that the random effects for different species are allowed to correlate (to a degree that depends on how closely they are related). So the usual assumption of random effects models---that the random effects are mutually independent--does not necessarily hold.

On Wed, Mar 24, 2021 at 8:33 PM Shinichi Nakagawa @.***> wrote:

Thank you, @jepusto https://github.com/jepusto - at the moment, yes, it does give some results but I do not know they are valid as you pointed out.

" whether the phylogenetic structure creates dependence across articles." The model assumes all random effects are independent of each other (normally distributed with 0 and certain sigma^2) so I do not think the phylogenetic structure creates dependence across articles. But I not completely sure about what you are meaning. Could you elaborate on it a bit more?

Meanwhile, I prepare a reproducible example and put it here first? Or should I go straight to R-SIG-meta listserv?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jepusto/clubSandwich/issues/64#issuecomment-806293581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCVGIUPTKBKSWBDKAVMKV3TFKHG7ANCNFSM4ZWHT7AA .

itchyshin commented 3 years ago

@jepusto - thanks! - will do this as soon as I can! (probably tomorrow)