[R] function of probability for normal distribution
Greg Snow
Greg.Snow at imail.org
Thu Jan 20 18:19:06 CET 2011
Jeremy,
I don't seem to remember signing up to have R-help be my personal e-mail :-)
It is common to use phi to represent the standard normal distribution (with mean 0, and variance 1), the "script/small/lower case" version is for the distribution (height of the bell curve) and the "block/capitol/upper case" is for the cumulative distribution.
So for arbitrary mean and variance you get 1/sigma * phi( (x-mu)/sigma ).
The general idea for any truncated distribution is that it will have the same shape as the non-truncated version, it just needs to be scaled so that the area is 1, the proper scaling is just the area under the original. So the formulas you see on that page start with the regular normal (phi) divided by the area under the curve between A and B which is just the difference in the cumulative distribution at those 2 points.
In R dnorm will correspond to phi and pnorm to PHI. You could use the exact formulas on that page, but it would be simpler to use the arguments to dnorm and pnorm.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of JClark
> Sent: Wednesday, January 19, 2011 4:04 PM
> To: r-help at r-project.org
> Subject: Re: [R] function of probability for normal distribution
>
>
>
> Dear Greg Snow,
>
> I'm a biologist trying to write a mathematical formula for a doubly
> truncated normal distribution to be used in the language "R". I realise
> this
> is simple stuff for a mathematician but I'm stumped.
> Wikipedia gives what seems a fairly simple formula - with function =
> maths
> with mean and standard deviation - but also phi - WHAT IS PHI !!?? -
> especially how do I write this in "R" and why is the top "phi" in
> italics ??
>
> Hoping you can help.
>
> Yours sincerely,
>
> Jeremy Clark
>
>
>
>
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Re-R-
> function-for-Probabilities-for-the-standard-normal-distribution-
> tp903639p3225457.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list