Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-analysis of single proportions - number of events / non-events missing in rma.uni object #39

Open
guido-s opened this issue Dec 23, 2020 · 4 comments
Labels
feature feature request

Comments

@guido-s
Copy link

guido-s commented Dec 23, 2020

Classification

Feature Request

Summary

Hi Wolfgang,

It looks like the number of events 'xi' and non-events 'mi' are not part of an rma.uni object (look for 666 in output of the two examples).

I guess the same is true for 'ti' and 'ri' in the meta-analysis of single rates or single correlations.

BTW, is there any difference between list elements 'ni' and 'ni.f'?

Best wishes,
Guido

Reproducible Example

str(rma.uni(xi = 666 + 0:1, ni = 2 * 666 + c(0, 2), measure = "PR"))
str(rma.uni(xi = 666 + 0:1, mi = 666 + 0:1, measure = "PR"))

sessionInfo()

Post output of sessionInfo() below:

R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] metafor_2.5-69 Matrix_1.2-18

loaded via a namespace (and not attached):
[1] compiler_4.0.3  mathjaxr_1.0-1  nlme_3.1-150    grid_4.0.3
[5] lattice_0.20-41
@wviechtb
Copy link
Owner

wviechtb commented Jan 4, 2021

Hi Guido,

Indeed, this info is not currently stored inside the returned object. The same applies to various other inputs (e.g., rma.uni(ri=0.5, ni=50, measure="COR")$ri is NULL). Is there a specific reason why you need this?

As for ni vs ni.f - the former has missings removed, the later does not. Compare:

rma.uni(xi = c(10,NA), ni = c(50,50), measure = "PR")$ni
rma.uni(xi = c(10,NA), ni = c(50,50), measure = "PR")$ni.f

@guido-s
Copy link
Author

guido-s commented Jan 5, 2021

Hi Wolfgang,

I was working on a function rma2meta() which takes a metafor object and 'transforms' it to a meta object, e.g., to produce a forest plot with meta or conduct a Copas analysis using metasens. Internally, I use R functions like metaprop() requiring the number of events and sample sizes. This started more like a toy project, however, I think it could be quite handy.

Best wishes, Guido

@wviechtb
Copy link
Owner

wviechtb commented Jan 5, 2021

In principle, I could add the input variables to the returned object. This actually happens for a few measures (such as "RD", "RR", and "OR") to make things like labbe() work (e.g., rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg)$ai.f). I have to think about how to do this properly, since these objects are such a mess anyway (don't look at str(rma(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg))). I will add this to my to-do list, but not sure when I will get to this. I'll keep this issue open as a reminder.

@bwiernik
Copy link
Contributor

bwiernik commented Jul 9, 2021

@wviechtb In psychmeta and easystats, we use attributes to store some of those sorts of things

@wviechtb wviechtb added the feature feature request label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature request
Projects
None yet
Development

No branches or pull requests

3 participants