From Thorn.Thaler at rdls.nestle.com  Wed May 11 09:11:10 2011
From: Thorn.Thaler at rdls.nestle.com (Thaler, Thorn, LAUSANNE,
	Applied Mathematics)
Date: Wed, 11 May 2011 09:11:10 +0200
Subject: [Rd] stats:::biplot.prcomp: Scaling, typo in the help file?
Message-ID: <F54EF8F1B477CF448729593FE421F6464F8FB5@HQVEVE0032.nestle.com>

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



[Rd] stats:::biplot.prcomp: Scaling, typo in the help file?
Thorn.Thaler at rdls.nestle.com (Thaler, Thorn, LAUSANNE,