ellessenne/rsimsum

Discrepancy between code and formula in paper

LaurenSamuels opened this issue · 3 comments

Hi- thank you for this extremely helpful package! I have noticed a discrepancy between the following line of code:

if (!is.null(se)) relerror_mcse <- 100 * (modelse / empse) * sqrt(se2_var / (4 * nsim * modelse^4) + 1 / (2 * nsim - 1))

and the corresponding formula in Table 6 of the Morris et al. Statistics in Medicine paper. To match what's written in the paper, the line of code would need to be
if (!is.null(se)) relerror_mcse <- 100 * (modelse / empse) * sqrt(se2_var / (4 * nsim * modelse^4) + 1 / (2 * (nsim - 1))) (parens around the final "nsim - 1"). I don't know which one is correct, but I'm guessing it's the one in the paper.

Hi @LaurenSamuels,

Great catch!

It is indeed as you guessed, the formula from the paper is the correct one. I also double-checked with Stata's simsum command, and that would be consistent with the simulations paper. I will fix this straight away, thanks very much for reporting this.

Alessandro

Now fixed in #46.

If you'd like to test this before I merge it, it can be done with:

library(remotes)
install_github("ellessenne/rsimsum", ref = github_pull("46"))

Thanks!

Thank you!