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

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

Closed
hsayles opened this issue Oct 13, 2023 · 1 comment
Closed

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

hsayles opened this issue Oct 13, 2023 · 1 comment

Comments

@hsayles
Copy link

hsayles commented Oct 13, 2023

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
Copy link
Owner

stmcg commented Oct 13, 2023

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

@stmcg stmcg closed this as completed Oct 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants