On Thu, Nov 14, 2024 at 5:57 AM Riccardo (Jack) Lucchetti
<p002264(a)staff.univpm.it> wrote:
For some work I'm doing, I need to apply PCA to data containing missing
values. So I dug up some old code that I had around, which implements
Stock and Watson's EM algorithm (detailed in the 2002 JBES article).
I'm attaching a script with the function and an example if anyone's
interested.
Of course, it'd be nice to make this procedure more readily available to
gretl users. I see four (not mutually exclusive) ways of doing so:
1) modify our existing "pca" command to handle missing values;
2) modify our existing "princomp" function to handle missing values;
3) create a small self-contained function package;
4) integrate the code into the existing "staticfactor" function package.
Which one do you this is best?
Not sure about "best", but it seems it wouldn't be super-difficult to
extend pca and princomp() to handle NAs in the manner of your hansl
function.
Allin