Estefenia Ramos
Estefenia Ramos

Reputation: 1

How to use properly sd Function

Is the sd function the biased or the unbiased standard deviation? If it is the unbiased one, what command would I have to use to get the biased one?

Upvotes: 0

Views: 54

Answers (1)

scott.pilgrim.vs.r
scott.pilgrim.vs.r

Reputation: 507

help(sd)

output: (sd and var use n-1)

Details
Like var this uses denominator n - 1.

To find population standard deviation: Even though var used n-1 we can manipulate it to use n instead.

x <- c(1,2,3,4,5)
n <- length(x)
sd_pop <- sqrt(var(x)*(n-1)/n)
sd_pop

Upvotes: 1

Related Questions