On Wed, 13 Nov 2019, Sven Schreiber wrote:
Am 13.11.2019 um 10:33 schrieb Riccardo (Jack) Lucchetti:
> On Wed, 13 Nov 2019, Stefano Fachin wrote:
>>
>> I think adding this to the GUI and extend it to operate on lists
>> is a great idea. We should be careful about definitions, though
>> - "standardize" means "center on the mean AND divide by standard
>> deviation". Probably something more neutral like "scale" or
>> "rescale" is more suitable for a function which can be flagged
>> to either center only or center + divide by s.d. (with or
>> without d.f. correction)
>
> I think Stefano has a point here; if I had to choose, I'd go by
> "rescale".
IMHO, if a very generic name is chosen (which in principle is fine with
me) then I would suggest to put more thought and perhaps more
functionality into it. For example R's scale function [...]
I would prefer not to go too far down the rabbit-hole here. IMO
specialized variants of (re)scaling would be more appropriate for
the "extra" addon.
What Stefano says is clearly right: mere centering is not truly
standardizing. Nonetheless, I think that what we're proposing (I
guess, Ioannis and me) under the function stdize() might be defended
as proper standardization (if that's what you want, and with
variants regarding the standard deviation) plus a little bonus if
what you actually want is to center a list of series.
To elaborate on the last point, centering is a simple one-liner
if you're working on a single series:
series cy = y - mean(y)
or a matrix:
matrix cX = X .- meanc(X)
but requires a slightly fiddly loop if you're working on a list:
list cL = null
loop foreach i L --quiet
cL += genseries(sprintf("c%s", "$i"), $i - mean($i))
endloop
So we overload the stdize() function with an option to let the user
do the last thing with ease. We could, instead, assign this job to a
separate function -- demean(), perhaps. But we're economists so we
know about trade-offs: in this case a slight warping of the implied
meaning of "stdize" versus further invasion of the function
namespace (plus some mild code bloat).
Allin