0
$\begingroup$

How can I determine the standard deviation of a normal distribution with known mean and a known percentile value?

The known percentile value would be on the correct side of the mean (eg, for percentile > 0.5, the value > mean), and the percentile would not be 0.5, as that would simply be equal to the mean, and therefore would tell one nothing about the variability.

This is an R function I use occasionally to do this; is there an analytic or arithmetic method/formula that could solve this? Would it be faster to compute?

#' Determine y in the equation `qnorm(mean=m,sd=y,p=p)==x`
get_sd_from_quantile_score <- function(m, p, x) {
  get_quantile_score <- function(y) { 
    qnorm(mean=m,sd=y,p=p)
  }
  f <- function(y) { (get_quantile_score(y) - x)^2 }
  opt <- optim(par = 1, fn = f, method = 'CG')
  return(opt$par)
}
$\endgroup$
  • 2
    $\begingroup$ Counterexample: p=0.5 (median) tells you nothing about as. $\endgroup$ – Tim Oct 9 '19 at 20:29
  • 4
    $\begingroup$ Questions asked as code make it hard for the many readers that aren't familiar with the language but would benefit from the answer. Its best to ask the question algebraically. Can you clarify - is the population mean known? $\endgroup$ – Glen_b -Reinstate Monica Oct 9 '19 at 21:36
  • 1
    $\begingroup$ Tim, great counterexample! Glen_b, agreed. The question could be rephrased as "Determine the standard deviation y of a normal distribution with mean m and quantile-p == x when p !=.5 (taking Tim's comment into account)." $\endgroup$ – ctesta01 Oct 10 '19 at 20:35
  • $\begingroup$ Hi @ctesta01, and welcome to stats.stackexchange. This site allows (and encourages!) editing of questions to improve the question and incorporate new information. I've taken the liberty of editing your question to include the information you provided, but feel free to edit again as needed. $\endgroup$ – Aaron left Stack Overflow Oct 11 '19 at 14:38
2
$\begingroup$

I believe simply (x-m)/qnorm(p) will do it, where m is the known mean and x is the known percentile p. qnorm(p) gives you how many standard deviations away from the mean the value is, and then you scale it by the given difference.

$\endgroup$
  • $\begingroup$ Ignores @Tim's counterexample posted earlier. In R, qnorm(.5) returns exactly 0. Then what? $\endgroup$ – BruceET Oct 10 '19 at 21:34
  • 1
    $\begingroup$ Especially with the OP's response in comments, I believe that's better added to the question, as a caveat that we know we're doing the computation with meaningful values. $\endgroup$ – Aaron left Stack Overflow Oct 11 '19 at 14:40
2
$\begingroup$

In general, you'll need to know two quantiles of a normal distribution in order to determine $\mu$ and $\sigma.$

Here is an example based roughly on the part of the Empirical Rule that says about 68% of the probability under a normal curve lies between $\mu \pm \sigma.$ Thus quantiles .16 and .84 of $\mathsf{Norm}(\mu=100,\sigma=15)$ are roughly at 85 and 115. Computations in R:

qnorm(c(.16,.84), 100, 15)
[1]  85.08313 114.91687

pnorm(c(85, 115), 100, 15)
[1] 0.1586553 0.8413447

By formulating two probabilies with quantiles, standardizing, and using printed tables of the standard normal CDF, you can obtain and solve two equations in unknowns $\mu$ and $\sigma.$ I will leave details of this self-study problem to you. When you see how it goes, maybe you can evaluate your R functions.

enter image description here

Note: If the two quantiles are very close to each other, you may need the additional accuracy that R provides (above printed normal tables) to get accurate values for $\mu$ and $\sigma.$

$\endgroup$
  • $\begingroup$ Thanks, but I wasn't asking to determine both μ and σ, just σ. I've accepted Aaron's answer since it correctly answers the question. $\endgroup$ – ctesta01 Oct 10 '19 at 20:33
  • 1
    $\begingroup$ True, but in the code included in the body of the first version of the question, it states that the mean is known as well, which would be the needed second quantile. I've edited the question and the title to include this information. $\endgroup$ – Aaron left Stack Overflow Oct 11 '19 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.