Re: [R] Sampling from a Matrix

2006-08-10 Thread Daniel Gerlanc
Once again, thanks for your help. I did not state the problem correctly, though the code is correct for what I want to do. A better description of the problem would be that there is a matrix of probabilities: > set.seed(1) > probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = list

Re: [R] Sampling from a Matrix

2006-08-09 Thread Marc Schwartz (via MN)
On Tue, 2006-08-08 at 14:10 -0400, Liaw, Andy wrote: > From: Marc Schwartz > > > On Fri, 2006-08-04 at 12:46 -0400, Daniel Gerlanc wrote: > > > Hello all, > > > > > > Consider the following problem: > > > > > > There is a matrix of probabilities: > > > > > > > set.seed(1) > > > > probs <- arra

Re: [R] Sampling from a Matrix

2006-08-08 Thread Liaw, Andy
From: Marc Schwartz > On Fri, 2006-08-04 at 12:46 -0400, Daniel Gerlanc wrote: > > Hello all, > > > > Consider the following problem: > > > > There is a matrix of probabilities: > > > > > set.seed(1) > > > probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), > dimnames = > > > list(1:5, l

Re: [R] Sampling from a Matrix

2006-08-04 Thread Marc Schwartz (via MN)
On Fri, 2006-08-04 at 12:46 -0400, Daniel Gerlanc wrote: > Hello all, > > Consider the following problem: > > There is a matrix of probabilities: > > > set.seed(1) > > probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = > > list(1:5, letters[1:5])) > > probs > a b

[R] Sampling from a Matrix

2006-08-04 Thread Daniel Gerlanc
Hello all, Consider the following problem: There is a matrix of probabilities: > set.seed(1) > probs <- array(abs(rnorm(25, sd = 0.33)), dim = c(5,5), dimnames = list(1:5, > letters[1:5])) > probs a b c de 1 0.21 0.27 0.50 0.0148 0.303 2 0.06 0.16 0.13 0.0053