-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
First of all, thank you for providing this package. I hope this is the right place to ask this.
I'm running into an error when using the mr_forest function with the "conmix" method:
Error in levels<-(*tmp*, value = as.character(levels)) : factor level [2] is duplicated
Several of my data inputs ran fine, but one input dataframe throws this error for the conmix method specifically (although I can't see anything obviously wrong with the data). A reproducible example is included below:
outcome<-"outcome"
exposure<-"exposure"
data <- data.frame(SNP = c("rs1", "rs2", "rs3", "rs4", "rs5","rs6","rs7", "rs8", "rs9"),
beta_exposure = c(-0.615, 0.092, -0.066, 0.065, 0.065,
0.059, 0.872, 0.063, -0.048),
se_exposure = c(0.020, 0.007, 0.007, 0.006, 0.007,
0.007, 0.116, 0.009, 0.007),
beta_outcome = c(-0.01260620, -0.00186184, 0.00275511, 0.00632551, 0.01032940,
-0.01004970, 0.02024740, 0.00547238, -0.01407590),
se_outcome = c(0.00965377, 0.00337398, 0.00316966, 0.00310217, 0.00329157,
0.00307773, 0.05899670, 0.00435493, 0.00342480))
MRInputObject <- mr_input(bx = data$beta_exposure,bxse = data$se_exposure,by = data$beta_outcome,byse = data$se_outcome,exposure=exposure,outcome=outcome,snps=data$SNP)
mr_forest(MRInputObject,snp_estimates=FALSE,methods=c("conmix"))
Any insights would be appreciated!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels