CTU-Bern / presize

Precision Based Sample Size Calculation

Home Page:https://ctu-bern.github.io/presize/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mean or mu?

gillesdutilh opened this issue · comments

The current arguments of prec_mean are mu and sigma, where statistically, it would make a lot of sense if they were mu and sigma, or mean and sd. I would opt for mu and sigma, since it describes the assumed true distribution.

Correcting this scores not so well on the tradeoff of correctness and backward compatibility. Maybe you could add a little comment in the argument descriptions.

Indeed, i am inclined to agree with you...
As you say, changing the argument name has implications for backwards compatibility....
@alimacher, @ostalder, any thoughts?

I would rather use mean and sd because 'laypersons' are more used to that.

a point to consider, which @gillesdutilh already mentioned, is that changing it will break peoples code if they explicitly refer to the name and require a bit of work (the function itself, helpfiles, examples, the shiny app, ... other stuff?).

One option might be to add a new argument (mean)...

prec_mean <- function(mean = NULL, sd, ..., mu = NULL){
  if(!is.null(mu) & is.null(mean)) mean <- mu
  ...
}

Discussed with Andi earlier... we will rename the argument (there's probably not so many users anyway)...

To change:

  • function itself
    • leave original argument in, but add a message that it no longer works and to use mean instead and move it to last position
  • helpfile
  • examples
  • shiny app
  • tests