Am 13.09.2022 um 11:51 schrieb Alison Loddick:
> I’m looking at panel regression, and one of the assumptions in
>
regression is to remove outliers. My data has a lot of outliers, and >
it impacts my residuals which are definitely not normal. I’m > wondering
if there is an easy way to remove the outliers?
Hello, for a standard regression (including the panel case), normality
is not a required assumption. (Unless you want to do "exact" inference
in small samples.) So perhaps you don't need to do anything at all.
Having said that and with respect to your practical question, after
initial estimation you could check for which observations the abs value
of the residuals (which you can save from your initial estimate)
exceeds, say, three times the standard error of the regression (which
you can also save). Then you could either restrict the sample to where
this is not the case, or you add a bunch of corresponding
impulse/observation dummies to your model. Right now I don't have the
time to be very specific about the details, sorry; maybe someone else
can jump in. (The problem with excluding observations in the panel case
is that very quickly the active dataset will lose the official panel
status in gretl because of the gaps. So the dummy solution might be better.)
The "leverage" command would be useful, but unfortunately only works
after the "ols" command, not after "panel". Maybe it could be enabled
at
least for fixed-effects estimation (in a future gretl version).
I'm not aware of any built-in functionality or contributed function
package which automatically constructs outlier-related dummies yet, but
maybe I'm missing something.
cheers
sven