Am 30.12.2020 um 10:44 schrieb Artur Bala:
Dear Allin,
I'm working on a function that involves iterative WLS in order to
correct OLS estimators in the presence of outliers. As a 1st step, the
function has to leave out observations with a Cook's distance (D) > 1.
Cook's D can be easily computed from the leverage series, what I do
through the following code within the function:
<hansl>
ols myY myX --quiet
... # retrieve some statistics here
leverage --quiet --save
series l = lever
... # some code for Cook's D based on l, OLS residuals and OLS se)
</hansl>
Now, the function works smoothly...unless a "lever" series already
exists in the dataset. In that case the following error message is
generated,
I don't see this problem here. You might have to send us a
self-contained example, preferably with one of gretl's shipped datasets.
What version is this?
thanks
sven