Skip to content
Prev 173291 / 398506 Next

Using napredict in prcomp

On Tue, 10 Mar 2009, Alain Paquette wrote:

            
I don't see an 'napredict' argument.  The help says

        x: if 'retx' is true the value of the rotated data (the centred
           (and scaled if requested) data multiplied by the 'rotation'
           matrix) is returned.  Hence, 'cov(x)' is the diagonal matrix
           'diag(sdev^2)'.  For the formula method, 'napredict' is
           applied to handle the treatment of values omitted by the
           'na.action'.

'napredict' is a function (so please look up its help), and it says R 
applies it, not that you need to.  It is napredict which gives you the 
NAs in the correct places.