You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried this out in combination with the metafor package. Given that df.residual(res) is not NULL, according to the docs I would have expected sim() to simulate using dist="t(df)" but that is not what is happening. Am I misunderstanding something or is this a bug?
A reproducible example:
library(metafor)
library(clarify)
### calculate log risk ratios and corresponding sampling variancesdat<- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
### random-effects modelres<- rma(yi, vi, data=dat)
res### average risk ratio with 95% CI
predict(res, transf=exp)
### use clarify
set.seed(1234)
sims<- sim(res)
sims# sampled from MVNsav<- sim_apply(sims, function(coefs) c(RR= mean(exp(coefs))), verbose=FALSE)
summary(sav, null=c(`RR`=1))
# but according to the docs, it should use dist="t(df)" when df.residual(res) is not NULL
df.residual(res)
The text was updated successfully, but these errors were encountered:
Thank you for the comment and sorry about this confusion! The documentation is outdated and needs to be fixed. We no longer rely on df.residual() but rather on functions in insight that attempt to extract the right degrees of freedom, in particular insight::get_df(). insight has detected that the distribution of the model coefficients is normal, so that makes its way to clarify as well. Of course, you can supply your own df, and in practice, this will not make much of a difference. But I will definitely fix that documentation issue.
Thanks for writing this package!
I tried this out in combination with the
metafor
package. Given thatdf.residual(res)
is notNULL
, according to the docs I would have expectedsim()
to simulate usingdist="t(df)"
but that is not what is happening. Am I misunderstanding something or is this a bug?A reproducible example:
The text was updated successfully, but these errors were encountered: