rookiestats wrote: ↑Fri Apr 14, 2023 1:37 am
I don't suppose you could explain each components of your formula?
What I showed you in the screenshot was like obtain with computed new variable in jamovi, the winsorization of a variable, as you could have done in R with the
winsorize() function of the R
datawizard package.
This feature has the ability to winsorize by selecting from
three possible
methods.
The "
zscore" method can provide a defined
non-robust winsorization using
mean and standard deviation, and a
robust one using
median and mad.
I've chosen to show you the non-robust version of the method.
The robust one is also possible, but a little longer to implement, because you don't already have a
VMAD() available, as instead you have
VMED() for the median of the variable of interest, or
VMEAN() for the mean and
VSTDEV() for the standard deviation.
So, referring to the screenshot variable,
VMEAN(myvar) to get the mean of the myvar variable and
VSTDEV(myvar) to get its standard deviation.
Thus it is possible to obtain the upper/lower cutoff value of myvar by adding/subtracting 20% of the standard deviation from the mean.
With the
nested IF() functions, the myvar values that are between the two cutoff values are intercepted, to be left unchanged during the computation of the
new wins_myvar variable, while the myvar values greater than the upper cutoff value will be replaced with the same upper cutoff value, while myvar values lower than the lower cutoff value will be replaced with the same lower cutoff value.
If you do not anticipate that the variables to be winsorized may undergo changes, to simplify, you can take and use what you need from a
Descriptive analysis of the variables of interest.
Cheers,
Maurizio