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

[BUG]: different results generate by mr() #517

Open
SunYidan2021 opened this issue May 14, 2024 · 2 comments
Open

[BUG]: different results generate by mr() #517

SunYidan2021 opened this issue May 14, 2024 · 2 comments
Labels

Comments

@SunYidan2021
Copy link

When I use mr() to execute analysis

res <- mr(dat)

The P-value changed all the time, although slightly different.
What should I set to make the result unchanged?

@tj0129edgar
Copy link

Set random seed.

@afanChat
Copy link

afanChat commented Jul 5, 2024

Need to set seed in the lapply environment.
res <- lapply(method_list, function(meth) { set.seed(1) ; get(meth)(x$beta.exposure, x$beta.outcome, x$se.exposure, x$se.outcome, parameters) })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants