stmcg / estmeansd

Estimating the Sample Mean and Standard Deviation from Commonly Reported Quantiles in Meta-Analysis
2 stars 2 forks source link

mln.mean.sd doesn't work with negative numbers for min.val #3

Closed hsayles closed 1 year ago

hsayles commented 1 year ago

mln.mean.sd(min.val = -1, med.val = 6, max.val = 11, n = 100) Error in value[3L] : attempt to apply non-function 4: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 3: tryCatchList(expr, classes, parentenv, handlers) 2: tryCatch({ suppressWarnings(stats::optim(par = c(mean.LW, sd.LW), fn = logL)) }, error = NULL) 1: mln.mean.sd(min.val = -1, med.val = 5, max.val = 10, n = 100)

stmcg commented 1 year ago

Hi,

Thanks for posting. The MLN method is based on a distributional assumption which assumes that the data are positive, and so the mln.mean.sd function does not work with negative data. Apologies for the confusing error message.

Feel free to reach out to me at sean_mcgrath@g.harvard.edu if you want to discuss some practical strategies with handling negative data for this type of analysis.

Best, Sean