Is it possible to calculate the standard deviation of a single yes/no question? For example, 100 people took the survey and 60 of them chose "yes", 40 of them chose "no".
I'm thinking using binomial distribution sd formula:
$$
\sqrt{np(1-p)}
$$
so it would be
$\sqrt{100*(60/100)*(1-60/100)}$
is this correct?
Best Answer
Comment: The previous comment from @JMoravitz refers to the variance of a binomial random variable. Perhaps your question is about a sample. So here is an example with a sample of $n=100$ Yes/No observations (coded as 1=Yes, 0=No).
Suppose you roll a fair die 100 times, counting
1
s as Yes and any other number as No. Then you might assign the value $1$ to1
(Yes) and the value $0$ to other outcomes (No). We might generate such a sample of $0$s and $1$s in R as follows:In this particular sample you have 14 Yes's and 86 No's.
You could use the usual formal $S = \frac{1}{n-1}\sum_{i=1}^n (X_i - \bar X)^2$ to find the sample standard deviation. The computation from R is as follows:
Note: This sample might be considered as 100 observations from the binomial (Bernoulli) distribution $\mathsf{Binom}(n=1, p= 1/6),$ which has mean $\mu = np = 1/6 = 0.6667$ and variance $\sigma^2 = np(1-p) = 5/36 = 0.1389.$ Notice that the sample variance $S = 0.1216$ is a fairly close estimate of $\sigma^2$---about as good an estimate as one can expect from a sample of size $n=100.$
In four additional samples of size $n = 100,$ I got sample variances $0.1616, 0.1789, 0.1067,$ and $0.1216,$ as shown below.