# sampling from normal

 Classic List Threaded
2 messages
Reply | Threaded
Open this post in threaded view
|

## sampling from normal

 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)   Regards               [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-helpPLEASE do read the posting guide http://www.R-project.org/posting-guide.htmland provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

## Re: sampling from normal

 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 this method. I may try another method. Such like: s1 <- rnorm(10000) n <- 5 a <- -1 sample(s1[s1