Skip to content
Back to formatted view

Raw Message

Message-ID: <CAJMZ3cfwprzp-xfHEonnoFLyb=h2jgBUz=tbrKwvZ=yQXzadMg@mail.gmail.com>
Date: 2013-11-18T21:23:16Z
From: email
Subject: find variation of a binary matrix

Hi:

I want to calculate how much the values in a binary matrix varies, and
for that I apply the sd() method.


mat <- matrix(c(1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1), nrow=4, ncol=3)
stddev <- sd(dist(mat,  method="binary"))

And i get the following answer:

stddev
[1] 0.3442652

Is this correct? Or there is a better way out?

Bests:

John