Closed JeffreyRStevens closed 2 years ago
Hi Jeffrey,
Thanks for the kind words and for reporting the issue!
The prior_scale
argument controls the effect size scale which is used for specifying prior distributions. The default prior specification (used in our simulation studies etc) is set on Cohen's d. The effect size input can be, however, on different scales as the package internally transforms both the effect size and prior distributions to Fisher's z scale. The reason for this is that Fisher's z has much better statistical properties. I would not recommend changing these defaults as they were tested across many settings and specifying prior distributions on a different effect size scale than Cohen's d can be much trickier.
That leads us to the cause of the error: the default prior distribution on the effect size - a Normal(0, 1) prior distribution often leads to effect sizes |r| > 1, causing this cryptic error message. I shall add a better error message that clarifies the issue and checks whether the prior distribution is compatible with the correlation scale.
I think that you actually want to summarize the results on the correlation scale. That can be done even if the prior distributions are specified on Cohen's d scale (as default). To do so, you need to add the output_scale = "r"
argument to the summary()
function.
E.g.,
summary(fit_z, output_scale = "r")
Which produces the output on the correlation scale. (The summary function internally transforms the posterior samples.)
Hope this solves the issue, Frantisek
Frantisek,
This is incredibly helpful and now the error totally makes sense.
So, to be clear, when I input the correlation coefficients in to the r
argument, they are transformed to Fisher's z scale. If I were to alter the prior distributions, they are in a Cohen's d scale, which is transformed to Fisher's z scale also. Then the computations are run on this. Then, if I include output_scale = "r"
in the summary()
call, the values are back transformed to correlation coefficients for presentation. Is that correct?
Again, many thanks for this!
Jeff
Hi Jeff,
Yes, that's correct indeed. (If you don't specify the output scale explicitly in the summary function, the summary will be produced on the same scale that was used for specifying prior distributions.)
Feel free to reopen the issue if you have any other questions.
Cheers, Frantisek
First, thank you for this awesome package! I'm working with correlational data for a meta-analysis, so I would prefer the output of
RoBMA()
to be in correlation coefficients. When I setprior_scale = "r"
, I receive the following error:When I do not set
prior_scale
or set it to"fishers_z"
, I do not receive the error. Here is a reproducible example using just a few chains/samples/etc. to shorten runtime:fit_r
results in the error, whereasfit_z
runs fine.I'm running {RoBMA} version 2.2.2 in R version 4.2.0 on Ubuntu 20.04. I also reinstalled {BayesTools}.