Am 12.11.2019 um 00:18 schrieb Allin Cottrell:
On Mon, 11 Nov 2019, Ioannis A. Venetis wrote:
>
> I do not know if it has been discussed previously...
Actually I saw that three years ago (Nov 2016) poor Stefano actually
suggested the same feature. I say "poor" because apparently nobody
really paid attention to him, at least with respect to the list
functionality.
Yes, that should probably be a built-in function for series and
lists
as well as columns of matrices.
If I'm remembering right we have a quite lengthy discussion of
cdemean() but with hindsight I don't think it turned out too well.
I could not reproduce how or when cdemean was introduced. (I just
remember when it got a second argument, and that's also in the
changelog. It was prompted by speed concerns in the PCA/factor analysis
area.)
It's hard-wired to (a) just operate on matrices and (b) either
just
subtract the mean, or do that plus divide by the standard deviation
with denominator n - 1. A "better" function, IMO, would allow
different types of argument and have an option to divide by the MLE of
the standard deviation.
I guess we could create a new function (stdize? center? or maybe, as
per R, scale?) which had greater generality. In that case cdemean
could be turned into an alias for the appropriate form of the new
function.
Yes, why not. I think I would like 'stdize' best. (Don't know what
exactly scale does in R, but it sounds even more general.)
thanks
sven