CTU-Bern / presize

Precision Based Sample Size Calculation
https://ctu-bern.github.io/presize/
GNU General Public License v3.0
15 stars 13 forks source link

mean or mu? #88

Closed gillesdutilh closed 2 years ago

gillesdutilh commented 2 years ago

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.

aghaynes commented 2 years ago

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

alimacher commented 2 years ago

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

aghaynes commented 2 years ago

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
  ...
}
aghaynes commented 2 years ago

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

To change: