[R] simulation

From: Thür Brigitte <Brigitte.Thuer_at_swica.ch>
Date: Tue, 01 May 2007 09:03:46 +0200


I would like to simulate datasets in the following way:

x <- rpois(999, 2000)
y <- sum(exp(rgamma(x, scale=2, shape=0.5)))

The problem is, that by calling "y" I just get 1 value back and not 999 values. Can anyone help me? Thanks!


        [[alternative HTML version deleted]]

R-help_at_stat.math.ethz.ch 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. Received on Tue 01 May 2007 - 07:11:35 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 Tue 01 May 2007 - 09:31:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.