JuliaStats / StatsBase.jl

Basic statistics for Julia
Other
584 stars 194 forks source link

sem is an unfortunate name for "standard error of the mean" #305

Open randyzwitch opened 7 years ago

randyzwitch commented 7 years ago

(continued from Slack)

I was looking to see if Julia had any work around structural equation models, of which the R package is sem. In StatsBase, sem refers to standard error of the mean, which feels not easily Google-able and possibly unnecessary to have as a function altogether.

sem within StatsBase is only used in defining the function and documentation, but I haven't evaluated whether other packages use it. Does it make sense to rename, remove, or leave alone as too trivial to worry about?

nalimilan commented 7 years ago

Renaming it would be fine if we can find a good alternative. What names do other software use?

randyzwitch commented 7 years ago

scipy uses sem Base R doesn't define it (plotrix package in R uses std.error, rapport packagerp.se.mean) MATLAB doesn't provide a function, according to this blog post

So scipy does lend support to having the name remain as sem, though I feel like semean or similar would be much less ambiguous.

andreasnoack commented 7 years ago

I don't think we need this function. It is not as common as other statistics and it is really simple to compute so I'd be in favor of just getting rid of the definition here to free the name down stream.

diegozea commented 7 years ago

I'm in favor of keeping the sem functionality, because the simplest version would be std(x)/sqrt(length(x)). So, the naive implementation is slower than the sqrt(var(x)/length(x)) of this definition. However, StatsBase exports stderr and sem. Could sem be renamed to stderr?

andreasnoack commented 7 years ago

I'd be fine with using stderr(Vector) for the mean implicitly. It couldn't really be anything else, could it?

nalimilan commented 7 years ago

I'd rather keep sem than using stderr for that. That's really a different operation from what stderr currently does (returning the standard errors of coefficients of a model), and the standard error of the mean is just one of the possible standard errors one can compute for a vector.

andreasnoack commented 7 years ago

That's really a different operation from what stderr currently does

No. It is exactly the same thing. It returns the estimated standard errordeviation of an estimator

is just one of the possible standard errors one can compute for a vector

Really? Which? The standard error of the variance? It is as implicit as stderr(RegressionModel) where it returns the estimated variance of the coefficients. It could also have been the standard error of the error variance.

jerlich commented 6 months ago

7 years later, I found out the name of the function because of this issue.