Skip to content
Back to formatted view

Raw Message

Message-ID: <F54EF8F1B477CF448729593FE421F6464F8FB5@HQVEVE0032.nestle.com>
Date: 2011-05-11T07:11:10Z
From: Thaler, Thorn, LAUSANNE, Applied Mathematics
Subject: stats:::biplot.prcomp: Scaling, typo in the help file?

Dear all,

>From the documentation of biplot.prcomp:

scale: The variables are scaled by 'lambda ^ scale' and the
       observations are scaled by 'lambda ^ (1-scale)' where
       'lambda' are the singular values as computed by 'princomp'.

>From the source code of prcomp:

    lam <- x$sdev[choices]
    n <- NROW(scores)
    lam <- lam * sqrt(n)
    if (scale < 0 || scale > 1) 
        warning("'scale' is outside [0, 1]")
    if (scale != 0) 
        lam <- lam^scale
    else lam <- 1
    if (pc.biplot) 
        lam <- lam/sqrt(n)
    biplot.default(t(t(scores[, choices])/lam), t(t(x$rotation[, 
        choices]) * lam), ...)


Thus, the observations are divided by the scale factor, i.e. they are scaled by lambda^(-scale) and not by lambda^(1-scale).

Am I missing something?

Kind Regards,

Thorn Thaler
Mathematician

Applied Mathematics Group 
Nestl? Research Center
PO Box 44 
CH-1000 Lausanne 26, Switzerland
Phone: +41 21 785 8220
Fax: +41 21 785 8556