Re: [R] sampling from normal

2010-10-19 Thread Wu Gong
Hi Solafah, You are right that two commands are equivalent when p= pnorm(a). You can check the results by following codes. n <- 5 a <- -1 set.seed(123456) qnorm(runif(n,0,pnorm(a))) p <- pnorm(a) set.seed(123456) qnorm(p*runif(n)) Anyway, the elements of the lower tail are not chosen equally by

[R] sampling from normal

2010-10-19 Thread solafah bh
Hello If i want to resample from the lower tail of normal distribution , are these commands equivelant??  lower tail :qnorm(runif(n,0,pnorm(a))) if a is a lower tail bound or  lower tail:qnorm(p*runif(n)) if p is the probability of each interval(the observations are divided to intervals)   Regard

Re: [R] sampling from normal distribution

2010-10-03 Thread Duncan Murdoch
On 03/10/2010 6:38 PM, solafah bh wrote: 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

Re: [R] sampling from normal distribution

2010-10-03 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@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 wan

[R] sampling from normal distribution

2010-10-03 Thread solafah bh
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)