[R] Re: clara(*, stand=) and pam(*, stand=)

Martin Maechler maechler at stat.math.ethz.ch
Mon Nov 17 19:58:04 CET 2003


>>>>> "ReCH" == optimisation1 stagiaire <optimisation1.stagiaire at lagardere-active.com>
>>>>>     on Mon, 17 Nov 2003 11:23:41 +0100 writes:

    ReCH> I need informations about the clara routine. The
    ReCH> on-line doc say that the argument stand is a logical,
    ReCH> indicating if the measurements in x are standardized
    ReCH> before calculating the dissimilarities. Measurements
    ReCH> are standardized for each variable (column), by
    ReCH> subtracting the variable's mean value and dividing by
    ReCH> the variable's mean absolute deviation. If we note
    ReCH> STAND = TRUE, I suppose that the data will not be
    ReCH> standardized before clustering. On the contrary, STAND
    ReCH> = FALSE means that the data will be standardized
    ReCH> before clustering.  Each sub-dataset is partitioned
    ReCH> into k clusters using the same algorithm as in
    ReCH> pam. But the pam routine argument stand is a logical;
    ReCH> if true, the measurements in x are standardized before
    ReCH> calculating the dissimilarities.  Measurements are
    ReCH> standardized for each variable (column), by
    ReCH> subtracting the variable's mean value and dividing by
    ReCH> the variable's mean absolute deviation. If x is
    ReCH> already a dissimilarity matrix, then this argument
    ReCH> will be ignored. If we note STAND = TRUE, I suppose
    ReCH> that the data will be standardized.

    ReCH> There is a big difference as clara and pam use nearly
    ReCH> the same algorithm.

There is no difference between  clara() and pam() concerning the
meaning and handling of the argument `stand'.

This is very quickly seen if you look at the two functiondefinitions
which both have almost the same statement 

        x2 <-
            if (stand) 
               scale(x, scale = apply(x, 2, meanabsdev))
            else x


    ReCH> I need to use clara because I have a large
    ReCH> dataset. Could help me about the argument stand ? May
    ReCH> I have to standardize my datas with excel before ? If
    ReCH> yes, what I have to write : STAND = ?? ?

    ReCH> Best regards,
    ReCH> Cordialement,

    ReCH> Régis CHARIGNON




More information about the R-help mailing list