I was wondering how I could have R tell me the SD (as an argument in the qnorm() built in R) for a normal distribution whose 95% limit values are already known?
As an example, I know the two 95% limit values for my normal are 158, and 168, respectively. So, in the below R code SD is shown as "x". If "y" (the answer of this simple qnorm() function) needs to be (158, 168), then can R tell me what should be x?
y <- qnorm(c(.025,.975), 163, x)
A general procedure for Normal distribution
Suppose we have a Normal distribution
X ~ N(mu, sigma), with unknown meanmuand unknown standard deviationsigma. And we aim to solve formuandsigma, given two quantile equations:We consider standardization:
Z = (X - mu) / sigma, so thatIn other words,
The RHS is explicitly known, and we define
beta1 = qnorm(alpha1),beta2 = qnorm(alpha2). Now, the above simplifies to a system of 2 linear equations:This system has coefficient matrix:
with determinant
beta2 - beta1. The only situation for singularity isbeta2 = beta1. As long as the system is non-singular, we can usesolveto solve formuandsigma.Think about what the singularity situation means.
qnormis strictly monotone for Normal distribution. Sobeta1 = beta2is as same asalpha1 = alpha2. But this can be easily avoided as it is under your specification, so in the following I will not check singularity.Wrap up above into an estimation function:
Let's have a test:
We can also do something arbitrary: