Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

F4-mu.GE

GE Matrix


Description

mu.GE returns a matrix with each element denoting the logical value if one value is greater than or equal to another.

Usage

mu.GE(x, y=x)

Arguments

x

data matrix, variables as columns

y

second data matrix, optional

Details

The (i,j) entry of GE matrix is 1 if \code{x_i >= y_j}, 0 otherwise. The square matrix GE is stored by column in a vector.

Value

a vector which contains the GE matrix.

Algorithm

mu.GE <- function(x, y=x) {
  <\dots>
  if (length(y)>1)
    apply(rbind(x,y),2,mu.GE,nrow(x))
  else 
    as.numeric(NAtoZer(outer(x[1:y],x[-(1:y)],">=")))
}

Author(s)

Knut M. Wittkowski kmw@rockefeller.edu, Tingting Song ttsong@gmail.com

Examples

a <- c(4, 2, 5, 1, 4, NA, 6)
mu.GE(a)

muStat

Prentice Rank Sum Test and McNemar Test

v1.7.0
GPL (>= 2)
Authors
Knut M. Wittkowski <kmw@rockefeller.edu> and Tingting Song <ttsong@gmail.com>
Initial release
2010-09-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.