(1) you need to examine the rnorm function, enter
?rnorm()
(2) when you review the documentation produced by entering the command
above, you will see that the rnorm function needs three parameter, the
number of values to generate, the mean of the numbers to be generated,
and the SD (standard dev
Hello everybody
Sorry if such a question has already been posted somewhere, but I wasnât able
to find an answer yet.
Iâm trying to generate random numbers for illustration purposes.
The random numbers should satisfy a multiple regression equation, for example:
z = 0.3 + 0.05 * x + 1.5 * y +
On Thu, Jul 19, 2012 at 04:12:07AM -0700, arunkumar wrote:
> hi
>
> My inputs is min=(10,10,10,10,10) and max=(100,100,100,100,100)
> total = 300
> i have to generate 5 numbers between min and max and those numbers should
> sum upto total
Hi.
Try the following.
while (1) {
x <- 10 +
Sent: Thursday, July 19, 2012 7:12 AM
Subject: [R] Generating Random Numbers
hi
My inputs is min=(10,10,10,10,10) and max=(100,100,100,100,100)
total = 300
i have to generate 5 numbers between min and max and those numbers should
sum upto total
Can anyone help?
-
Thanks in Advance
On Thu, Jul 19, 2012 at 04:12:07AM -0700, arunkumar wrote:
> hi
>
> My inputs is min=(10,10,10,10,10) and max=(100,100,100,100,100)
> total = 300
> i have to generate 5 numbers between min and max and those numbers should
> sum upto total
Hi.
If we subtract the minimum from each number, then
Those restrictions you have given do not define a unique distribution!
so you need to think better
about what you need. For instance, if you want a uniform distribution
between min and max with n=5
independent observations from that, but conditional upon sum=total.
For that, you could use rejectio
Is this homework?
runif() is one way to generate random numbers, but there are others
depending on the distribution desired. And of course the fifth number
is deterministic.
Sarah
On Thu, Jul 19, 2012 at 7:12 AM, arunkumar wrote:
> hi
>
> My inputs is min=(10,10,10,10,10) and max=(100,100,1
hi
My inputs is min=(10,10,10,10,10) and max=(100,100,100,100,100)
total = 300
i have to generate 5 numbers between min and max and those numbers should
sum upto total
Can anyone help?
-
Thanks in Advance
Arun
--
View this message in context:
http://r.789695.n4.nabble.com/Generating
8 matches
Mail list logo