0
$\begingroup$

"The values at p = 0.05 (one-sided) from a distribution of 5000 values, which is normal, was determined as the threshold"!

would you please help me and tell me how should I calculate it?

$\endgroup$
  • $\begingroup$ I am learning stat by myself and I am trying to implement a method in R :) $\endgroup$ – EpiMan Sep 24 '15 at 13:55
  • $\begingroup$ Then add the self-study tag. Also, do you know a priori that the data is normally distributed and you want to find the 95% quantile of the data or have you estimated the parameters for a normal distribution and want to find the quantile based in the parameters? $\endgroup$ – Gumeo Sep 24 '15 at 13:57
  • $\begingroup$ The data is normally distributed. Therefore, "The values at p = 0.05 (one-sided) from a normal distribution" means 95% quantile of the data, did I get it correctly? @GuðmundurEinarsson would you explain a bit more? what does p = 0.05 mean in terms of PDF or CDF? $\endgroup$ – EpiMan Sep 24 '15 at 14:17
  • $\begingroup$ I'm on the train, I'll write an answer when I get home in approximately 30 minutes. $\endgroup$ – Gumeo Sep 24 '15 at 14:33
0
$\begingroup$

If you simply want to calculate it in R, you can do it like this:

val.mean <- mean(values)
sd.mean <- sd(mean)
qnorm(0.95, val.mean, sd.mean)
$\endgroup$
1
$\begingroup$

You can calculate the sample quantile, which is independent of your normality assumption, but if your data is normally distributed, they should be approximately the same.

Here is some code to try this:

####################################
# Small demonstration on quantiles #
####################################

# Generate 5000 normally distributed values
# with mean mu and sd sigma
mu <- 27
sigma <- 20
x <- rnorm(5000,mu,sigma)

# Look at a histogram
hist(x,breaks=50)

# Quantile from data
print(quantile(x,probs=0.95))

# Quantile from parameters of a fitted normal distribution
print(qnorm(0.95,mean=mean(x),sd=sd(x)))

I get 59.58532 from the quantile function and 60.15717 from the qnorm function. They are very similar because my sample is generated from a normal distribution.

These are two different ways of doing this. It depends on your application of which method you would choose.

$\endgroup$

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.