Skip to content

factor score from PCA

2 messages · ya, Sarah Goslee

#
Arguments:
scores: a logical value indicating whether the score on each
          principal component should be calculated.
Value:
  scores: if ?scores = TRUE?, the scores of the supplied data on the
          principal components.  These are non-null only if ?x? was
          supplied, and if ?covmat? was also supplied if it was a
          covariance list.  For the formula method, ?napredict()? is
          applied to handle the treatment of values omitted by the
          ?na.action?.

     ## NA-handling
     USArrests[1, 2] <- NA
     pc.cr <- princomp(~ Murder + Assault + UrbanPop,
                       data = USArrests, na.action=na.exclude, cor = TRUE)
     pc.cr$scores[1:5, ]
Arguments:
  scores: If TRUE, find component scores
Value:
  scores: If scores=TRUE, then estimates of the factor scores are
          reported

So the scores are returned as pc$scores in your example, and princomp
will also calculate them.

Sarah
On Fri, Oct 19, 2012 at 11:30 AM, ya <xinxi813 at 126.com> wrote: