Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the R equivalent to Excel's =2*NORMSDIST(2)

Tags:

r

excel

In Excel =2*NORMSDIST(2) puts out ~1.96. How do I get that same value in R?

like image 377
timothy.s.lau Avatar asked Sep 17 '14 03:09

timothy.s.lau


People also ask

What is Normsdist in Excel mean?

The NORMDIST Function[1] is categorized under Excel Statistical functions. It will return the normal distribution for a stated mean and standard distribution. That is, it will calculate the normal probability density function or the cumulative normal distribution function for a given set of parameters.

What is Normsinv R?

NORMSINV is an Excel function that provides a Z value for a cumulative probability using a standard normal distribution. If you assume your data is normally distributed and are interested in knowing the Z value for a given probability, NORMSINV will provide that using the cumulative probabilities of the distribution.

What is the formula for Normsinv?

The syntax for the NORMSINV function is: =NORMSINV(x, mean, standard_deviation). x is the value for which you want to find the probability, mean is the mean of the standard normal distribution, and standard_deviation is the standard deviation of the standard normal distribution.

How do you use Normsdist in Excel?

NORMSDIST is a function in Excel that calculates the normal distribution for a given set of data. To use NORMSDIST, you first need to input the data that you want to use for the calculation. Then, you need to specify the mean and standard deviation of the data.

What is Normsdist used for?

Returns the standard normal cumulative distribution function. The distribution has a mean of 0 (zero) and a standard deviation of one. Use this function in place of a table of standard normal curve areas.


2 Answers

If you want to get the two-sided 95% confidence limit for a z-score, you would use =NORMSINV(0.975) (which is =NORMSINV(1 - (1-0.95)/2)). The fact that your formula gives approximately the same number is nothing more than a coincidence.

The equivalent in R would be qnorm(0.975) or qnorm(1 - (1-0.95)/2).

like image 124
Hong Ooi Avatar answered Sep 20 '22 10:09

Hong Ooi


You can get that value in R with

2*pnorm(2)

The pnorm() function is the cumulative density function for a normal random variable

enter image description here

Which is consistent with the description of the Excel NORMDIST function

NORMSDIST(z) returns the probability that the observed value of a standard normal random variable will be less than or equal to z. A standard normal random variable has mean 0 and standard deviation 1 (and also variance 1 because variance = standard deviation squared).

like image 33
MrFlick Avatar answered Sep 20 '22 10:09

MrFlick