StatsBase.jl icon indicating copy to clipboard operation
StatsBase.jl copied to clipboard

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

Open randyzwitch opened this issue 8 years ago • 8 comments
trafficstars

(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?

randyzwitch avatar Sep 21 '17 00:09 randyzwitch

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

nalimilan avatar Sep 21 '17 09:09 nalimilan

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.

randyzwitch avatar Sep 21 '17 13:09 randyzwitch

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.

andreasnoack avatar Sep 22 '17 08:09 andreasnoack

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?

diegozea avatar Sep 22 '17 09:09 diegozea

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

andreasnoack avatar Sep 22 '17 11:09 andreasnoack

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.

nalimilan avatar Sep 22 '17 11:09 nalimilan

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

No. It is exactly the same thing. It returns the estimated standard ~~error~~deviation 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.

andreasnoack avatar Sep 22 '17 11:09 andreasnoack

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

jerlich avatar May 20 '24 13:05 jerlich