Re: [R] Replacing sets of rows in matrix within a loop

2012-11-02 Thread Gordon
I'm having a similar problem , did u get a resolution ? -- View this message in context: http://r.789695.n4.nabble.com/Replacing-sets-of-rows-in-matrix-within-a-loop-tp4634658p4648248.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Replacing sets of rows in matrix within a loop

2012-06-29 Thread nqf
Thank you Rui, this is indeed much simpler than anything I had thought of trying, and works perfectly. From: Rui Barradas [via R] [ml-node+s789695n4634712...@n4.nabble.com] Sent: 28 June 2012 09:44 To: Natalie Franklin Subject: Re: Replacing sets of rows in matr

Re: [R] Replacing sets of rows in matrix within a loop

2012-06-28 Thread Rui Barradas
Hello, You are replacing the values of runif each time through the loop. And it's not just that, every time through, you are setting outcome[, 1] and outcome[, 2] to the same values. Simply put, the loop is not needed. Corrected: n <- 100 ## patients per trial trials <- 3 ## 3 trials med <-

[R] Replacing sets of rows in matrix within a loop

2012-06-27 Thread nqf
Dear R-help, I am writing some simulation code to create multiple sets of time-to-event clinical trial data (for use in meta-analysis). Within each trial, I want to apply censoring via simulation of uniform variables (with minimum zero and maximum the median outcome time for that particular trial)