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

Problem getting consonance intervals from rma.mh() #15

Open
reital opened this issue Jan 19, 2020 · 2 comments
Open

Problem getting consonance intervals from rma.mh() #15

reital opened this issue Jan 19, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@reital
Copy link

reital commented Jan 19, 2020

I am planning to produces consonance intervals for a meta-analysis Project. I need to use Mantel-Haenszel method to pool binary outcome. Here is an issue I ran in to.

library(metafor)
library(concurve)
#dataset from metafor
data(dat.linde2005) 
#pool binary outcomes using RR with fixed effects in linear model with rma.uni function
justsomeRR<-rma.uni(ai=ai,bi=(n1i-ai),ci=ci,di=(n2i-ci),data=dat.linde2005,measure="RR",add=0.5,digits=2,method="FE")
#get consonance intervals
metaf<-curve_meta(justsomeRR,steps=100)
#pool binary outcomes using RR based on fixed effects Mantel-Haenszel methods with rma.mh function
justsomeRR.2<-rma.mh(ai=ai,bi=(n1i-ai),ci=ci,di=(n2i-ci),data=dat.linde2005,measure="RR",add=0.5,digits=2)
#a problem with consonance intervals
metaf2<-curve_meta(justsomeRR.2,steps=100)
@zadrafi zadrafi self-assigned this Jan 22, 2020
@zadrafi
Copy link
Owner

zadrafi commented Jan 22, 2020

Hi @reital, I figured out the problem was the way in which the confint.rma.mh function was taking levels arguments, which differs from confint.default. I've currently updated the package to address this issue and it seems to be working fine.

Update it by using :

library(devtools)
install_github("zadrafi/concurve")
library(concurve)

And then load the code as you did before.

library(metafor)
library(concurve)
# dataset from metafor
data(dat.linde2005) 

Note: There is some missing data in linde2005, which will need to be addressed before using concurve, I've done so below by casewise deletion for this example

sum(is.na(dat.linde2005))
colSums(is.na(dat.linde2005))
dat.linde2005 <- na.omit(dat.linde2005)
# pool binary outcomes using RR with fixed effects in linear model with rma.uni function

justsomeRR<-rma.uni(ai=ai,bi=(n1i-ai),ci=ci,di=(n2i-ci), 
data=dat.linde2005,measure="RR",add=0.5,digits=2,method="FE")

# get consonance intervals

metaf<-curve_meta(justsomeRR, measure = "ratio", steps=1000)
# pool binary outcomes using RR based on fixed effects Mantel-Haenszel 
# methods with rma.mh function

justsomeRR.2<-rma.mh(ai=ai,bi=(n1i-ai),ci=ci,di=(n2i-ci),data=dat.linde2005,add=0.5,digits=2)

metaf2<-curve_meta(justsomeRR.2, measure = "ratio", method = "mh")

ggcurve(metaf2[[1]], type ="c", measure = "ratio")

@zadrafi zadrafi added the bug Something isn't working label Jan 23, 2020
@reital
Copy link
Author

reital commented Mar 19, 2020

Great! But now I ran to a new problem.

Running the code as above I get:

> metaf2<-curve_meta(justsomeRR.2, measure = "ratio", method = "mh")
  |===============================================================================================| 100%, Elapsed 00:00
Warning messages:
1: In pbmclapply(intrvls_mh, FUN = function(i) unlist(confint.rma.mh(object = x,  :
  mc.cores > 1 is not supported on Windows due to limitation of mc*apply() functions.
  mc.core is set to 1.
2: In pbmclapply((1:(length(results))), FUN = function(j) results[[j]][2:3]) :
  mc.cores > 1 is not supported on Windows due to limitation of mc*apply() functions.
  mc.core is set to 1.

No matter what value I set for steps, I get only 198 intervals. I guess this has something to do with Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants