[R] sampling from normal distribution

Daniel Nordlund djnordlund at frontier.com
Mon Oct 4 01:15:56 CEST 2010



> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
> On Behalf Of solafah bh
> Sent: Sunday, October 03, 2010 3:39 PM
> To: R help mailing list
> Subject: [R] sampling from normal distribution
> 
> Hello
> If i want to resampl from the tails of normal distribution , are these
> commans equivelant??
>   upper tail:qnorm(runif(n,pnorm(b),1))  if b is an upper tail boundary
>   or
>   upper tail:qnorm((1-p)+p(runif(n))  if p is the probability of each
> interval (the observatins are divided to intervals)
> 
> Regards
> 
> 
> 

Yes, they are equivalent, although the second formula is missing a closing parenthesis and a multiplication operator.  You could also simplify the second formula to 

> qnorm(1-p*runif(n))

Hope this is helpful,

Dan

Daniel Nordlund
Bothell



More information about the R-help mailing list