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

2012-06-29 Thread nqf
colnames(outcome) <- c("patient", "trial", "value") Simpler, no? Hope this helps, Rui Barradas Em 27-06-2012 19:01, nqf escreveu: > Dear R-help, > > I am writing some simulation code to create multiple sets of time-to-event > clinical trial data

[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)

Re: [R] Trying to speed up an if/else statement in simulations

2012-06-19 Thread nqf
Perfect, I now have a choice of workable solutions. Thanks a lot for your help, much appreciated. Natalie -- View this message in context: http://r.789695.n4.nabble.com/Trying-to-speed-up-an-if-else-statement-in-simulations-tp4633725p4633862.html Sent from the R help mailing list archive at Nabb

[R] Trying to speed up an if/else statement in simulations

2012-06-18 Thread nqf
Dear R-help, I am trying to write a function to simulate datasets of size n which contain two time-to-event outcome variables with associated 'Event'/'Censored' indicator variables (flag1 and flag2 respectively). One of these indicator variables needs to be dependent on the other, so I am creating