Re: [R] Problem in applying if statment

From: Gabor Grothendieck <>
Date: Thu, 26 Jun 2008 23:58:45 -0400


RSiteSearch("rejection sampling")

On Thu, Jun 26, 2008 at 11:52 PM, Nadeem Shafique <> wrote:
> Respected All,
> I am writing a program in R and facing some problem with applying "if statment".
> Program first draw random numbers from bivariate normal distribution
> then compute variable say Pi and Pij from that sample and
> then further computation
> ......
> .....
> .....
> In some samples Pij is appearing with negitive sign and ultimately
> resulted in an negative variance estimator. Now i want to design the
> program like this if the Pij is negative then go back and draw another
> sample until we get a sample that produces positive Pij and then move
> forward for further processing.
> Best Regards,
> Nadeem Shafique Butt mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 27 Jun 2008 - 04:02:36 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 27 Jun 2008 - 06:30:48 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive