Learn R Programming

sna (version 0.3)

event2dichot: Convert an Observed Event Matrix to a Dichotomous matrix

Description

Given a valued adjacency matrix (possibly derived from observed interaction ``events''), event2dichot returns a dichotomous adjacency matrix.

Usage

event2dichot(m, method="quantile", thresh=0.5, leq=FALSE)

Arguments

m
An adjacency matrix
method
One of ``quantile,'' ``rquantile,'' ``cquantile,'' ``mean,'' ``rmean,'' ``cmean,'' ``absolute,'' ``rank,'' ``rrank,'' or ``crank''
thresh
Dichotomization thresholds for ranks or quantiles
leq
Boolean indicating whether values less than or equal to the threshold should be taken as existing edges; the alternative is to use values strictly greater than the threshold

Value

  • The dichotomized data matrix

Details

The methods used for choosing dichotomization thresholds are as follows:

  1. quantile: specified quantile over the distribution of all edge values
  2. rquantile: specified quantile by row
  3. cquantile: specified quantile by column
  4. mean: grand mean
  5. rmean: row mean
  6. cmean: column mean
  7. absolute: the value ofthreshitself
  8. rank: specified rank over the distribution of all edge values
  9. rrank: specified rank by row
  10. crank: specified rank by column

Note that when a quantile, rank, or value is said to be ``specified,'' this refers to the value of thresh.

References

~put references to the literature/web site here ~

Examples

Run this code
#Draw a matrix of normal values
n<-matrix(rnorm(25),nrow=5,ncol=5)

#Dichotomize by the mean value
event2dichot(n,"mean")

#Dichotomize by the 0.95 quantile
event2dichot(n,"quantile",0.95)

Run the code above in your browser using DataLab