Grokbase Groups R r-help March 2002
FAQ
The problems with the HTML mailing list archives at CRAN should be
fixed now, I have re-created the pages for 2002 using the original
archives from Martin M?chler. r-help and r-devel are now splitted
by month to reduce the size of the index pages a little bit.

Best,

--
-------------------------------------------------------------------
Friedrich Leisch
Institut f?r Statistik Tel: (+43 1) 58801 10715
Technische Universit?t Wien Fax: (+43 1) 58801 10798
Wiedner Hauptstra?e 8-10/1071 Friedrich.Leisch at ci.tuwien.ac.at
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch
-------------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Search Discussions

  • Petra Steiner at Mar 21, 2002 at 10:29 pm
    Hello!

    I am looking for an implementation of the Russell-Rao-Coefficient
    (Product-Moment-Coefficient). I cannot find it in the usual packages (mva,
    cluster etc.)

    And is there already a function for the transformation of matrixes to
    binary matrixes in R?

    Hope that this questions are not too trivial or already explained somewhere
    else, I have not yet got the books.

    Regards,
    Petra

    -
    ---------------------------------------------------
    Petra Steiner
    Arbeitsbereich Linguistik
    Universitaet Muenster
    Huefferstrasse 27
    48149 Muenster

    Tel: 0251 / 83 39442
    petra at marley.uni-muenster.de
    http://santana.uni-muenster.de/~petra/

    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • Petra Steiner at Mar 26, 2002 at 7:07 pm
    Hello,

    and thanks for the two responses to my questions on binary matrixes, which
    showed me that the functions I needed do not exist.

    To get a distance matrix with the Russell-Rao-coefficient, I first have to
    compare each row of a binary matrix with each row and count how many
    elements are
    a. equal
    and
    b. 1.

    by
    f <- function(x,y) (sum(x == 1& y == x))

    Now how can I iterate this over a matrix without a loop? I think apply etc.
    will not work in this case.

    Thanks for any help.

    Regards,
    Petra

    -
    ---------------------------------------------------
    Petra Steiner
    Arbeitsbereich Linguistik
    Universitaet Muenster
    Huefferstrasse 27
    48149 Muenster

    Tel: 0251 / 83 39442
    petra at marley.uni-muenster.de
    http://santana.uni-muenster.de/~petra/





    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • Huntsinger, Reid at Mar 26, 2002 at 7:47 pm
    I don't know the Russell-Rao coefficient but maybe this will help:

    You can compute the number of times y and x are both 1 (that's what your
    function f does) by counting 1s in y*x, i.e., sum(y*x), aka t(y)%*%x.
    Ordinary matrix multiplication does this row-by-column, so if M and N are
    two binary matrices, M%*%t(N) will have (i,j) entry equal to the count of 1s
    in common to row i of M and row j of N.

    Hope I've understood the problem correctly.

    Reid Huntsinger

    -----Original Message-----
    From: Petra Steiner [mailto:steinep at uni-muenster.de]
    Sent: Tuesday, March 26, 2002 2:08 PM
    To: r-help at stat.math.ethz.ch
    Subject: [R] comparing row by row in matrix


    Hello,

    and thanks for the two responses to my questions on binary matrixes, which
    showed me that the functions I needed do not exist.

    To get a distance matrix with the Russell-Rao-coefficient, I first have to
    compare each row of a binary matrix with each row and count how many
    elements are
    a. equal
    and
    b. 1.

    by
    f <- function(x,y) (sum(x == 1& y == x))

    Now how can I iterate this over a matrix without a loop? I think apply etc.
    will not work in this case.

    Thanks for any help.

    Regards,
    Petra

    -
    ---------------------------------------------------
    Petra Steiner
    Arbeitsbereich Linguistik
    Universitaet Muenster
    Huefferstrasse 27
    48149 Muenster

    Tel: 0251 / 83 39442
    petra at marley.uni-muenster.de
    http://santana.uni-muenster.de/~petra/





    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
    -.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
    _._


    ------------------------------------------------------------------------------
    Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

    ==============================================================================

    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
  • Petra Steiner at Mar 26, 2002 at 10:18 pm
    Thank you, that is the solution.

    And the RR-coeffizient (number of agreements/total number) is this:
    (ma%*%t(ma)) / ncol(ma)

    Regards, Petra

    I don't know the Russell-Rao coefficient but maybe this will help:

    You can compute the number of times y and x are both 1 (that's what your
    function f does) by counting 1s in y*x, i.e., sum(y*x), aka t(y)%*%x.
    Ordinary matrix multiplication does this row-by-column, so if M and N are
    two binary matrices, M%*%t(N) will have (i,j) entry equal to the count of 1s
    in common to row i of M and row j of N.

    Hope I've understood the problem correctly.

    Reid Huntsinger

    -----Original Message-----
    From: Petra Steiner [mailto:steinep at uni-muenster.de]
    Sent: Tuesday, March 26, 2002 2:08 PM
    To: r-help at stat.math.ethz.ch
    Subject: [R] comparing row by row in matrix


    Hello,

    and thanks for the two responses to my questions on binary matrixes, which
    showed me that the functions I needed do not exist.

    To get a distance matrix with the Russell-Rao-coefficient, I first have to
    compare each row of a binary matrix with each row and count how many
    elements are
    a. equal
    and
    b. 1.

    by
    f <- function(x,y) (sum(x == 1& y == x))

    Now how can I iterate this over a matrix without a loop? I think apply etc.
    will not work in this case.

    Thanks for any help.

    Regards,
    Petra

    -
    ---------------------------------------------------
    Petra Steiner
    Arbeitsbereich Linguistik
    Universitaet Muenster
    Huefferstrasse 27
    48149 Muenster

    Tel: 0251 / 83 39442
    petra at marley.uni-muenster.de
    http://santana.uni-muenster.de/~petra/





    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. -.
    -.-
    r-help mailing list -- Read
    http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
    _._


    -------------------------------------------------------------------------- ----
    Notice: This e-mail message, together with any attachments, contains
    information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that
    may be confidential, proprietary copyrighted and/or legally privileged, and
    is intended solely for the use of the individual or entity named in this
    message. If you are not the intended recipient, and have received this
    message in error, please immediately return this by e-mail and then delete
    it.
    ============================================================================>

    -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
    r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
    Send "info", "help", or "[un]subscribe"
    (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
    _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedMar 21, '02 at 11:39a
activeMar 26, '02 at 10:18p
posts5
users3
websiter-project.org
irc#r

People

Translate

site design / logo © 2017 Grokbase