How Can I calculate the standard deviation of a yes/no question? 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?

mydaruma25

mydaruma25

Answered question

2022-09-23

How Can I calculate the standard deviation of a yes/no question?
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: n p ( 1 p ) so it would be 100 ( 60 / 100 ) ( 1 60 / 100 ) is this correct?

Answer & Explanation

Nancy Ewing

Nancy Ewing

Beginner2022-09-24Added 7 answers

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 1s as Yes and any other number as No. Then you might assign the value 1 to 1 (Yes) and the value 0 to other outcomes (No). We might generate such a sample of 0s and 1s in R as follows:
set.seed(2020)
x = rbinom(100, 1, 1/6)
x
[1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1
[26] 0 0 0 0 0 1 0 1 1 0 0 0 1 0 0 1 0 1 1 0 0 0 0 0 0
[51] 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0
[76] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
table(x)
x
0 1
86 14
In this particular sample you have 14 Yes's and 86 No's.
You could use the usual formal S = 1 n 1 i = 1 n ( X i X ¯ ) 2 to find the sample standard deviation. The computation from R is as follows:
var(x)
[1] 0.1216162
Note: This sample might be considered as 100 observations from the binomial (Bernoulli) distribution B i n o m ( n = 1 , p = 1 / 6 ) ,, which has mean μ = n p = 1 / 6 = 0.6667 and variance σ 2 = n p ( 1 p ) = 5 / 36 = 0.1389. Notice that the sample variance S=0.1216 is a fairly close estimate of σ 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.
var(rbinom(100,1,1/6))
[1] 0.1616162
var(rbinom(100,1,1/6))
[1] 0.1788889var(rbinom(100,1,1/6))[1] 0.1066667var(rbinom(100,1,1/6))[1] 0.1216162

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Research Methodology

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?