[R-meta] Deviance and it d.f. in pairwise meta analysis
Viechtbauer, Wolfgang (NP)
wo||g@ng@v|echtb@uer @end|ng |rom m@@@tr|chtun|ver@|ty@n|
Wed Mar 5 14:36:53 CET 2025
Dear Marimuthu,
You can use df.residual() to obtain these:
> df.residual(res1)
[1] 12
I am not sure what you mean by 'its distribution'. The df are not a statistic, so they do not have a distribution.
By the way, no need for REML=F in fitstats() if the model was fitted with ML (fitstats() automatically then provides the ML values).
Best,
Wolfgang
> -----Original Message-----
> From: R-sig-meta-analysis <r-sig-meta-analysis-bounces using r-project.org> On Behalf
> Of Marimuthu S via R-sig-meta-analysis
> Sent: Monday, March 3, 2025 22:12
> To: Marimuthu S via R-sig-meta-analysis <r-sig-meta-analysis using r-project.org>
> Cc: Marimuthu S <sm using mcmaster.ca>
> Subject: [R-meta] Deviance and it d.f. in pairwise meta analysis
>
> Hello Everyone,
>
> I fitted meta-analysis model using rma() function. I can extract all the fit
> statistics using fitstats() function. But it doesn't give degrees of freedom
> (d.f) for deviance.
>
> Could you please let me know if it's possible to calculate the deviance degrees
> of freedom (d.f.) and derive its distribution in pairwise meta-analysis? If it's
> not feasible, I'd appreciate understanding the reasons behind it. Any insights
> or leads would be greatly appreciated. Thank you for your time!
>
> Here is my code:
>
> library(metafor)
>
> dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)
> ### fit random-effects model
> res1 <- rma(yi, vi, data=dat, method="ML")
>
> > fitstats(res1, REML=F)
> ML
> logLik: -12.66508
> deviance: 37.11602
> AIC: 29.33015
> BIC: 30.46005
> AICc: 30.53015
>
> Regards,
>
> Marimuthu,
> Ph.D. candidate
> McMaster University, Canada
More information about the R-sig-meta-analysis
mailing list