[R] avoid error within for loop, try, trycatch, while, move to next iteration, unlist

2012-05-26 Thread Λεωνίδας Μπαντής
Hi there, I would like to ask something about how to avoid a possible error message within a for loop. I am running a simulation and in some repetitions there may be an error that will cause a crash and stop the whole procedure, what I want is to simply move on to the next iteration

[R] cox regression extract strata as numeric

2009-10-27 Thread Λεωνίδας Μπαντής
Hi there, I perform a stratified cox and then I need the strata as a  numeric array straft.ln ft.ln - coxph(Surv(times,deaths)~ages+chemos+chemos:f1+chemos:f2+horms+horms:f1+horms:f2+grades+grades:f1+grades:f2+positives+positives:f1+positives:f2+sizes+sizes:f1+sizes:f2+strata(stra),data=ddd)

[R] cox memory

2009-09-22 Thread Λεωνίδας Μπαντής
Hi there, I have a rather large data set and perform the following cox model: test1 - list(tstart,tstop,death1,chemo1,radio1,horm1) out1-coxph( Surv(tstart,tstop, death1) ~

[R] cox memory

2009-09-22 Thread Λεωνίδας Μπαντής
If I use the following newdata=data.frame(chemo1=0, horm1=0, age1=mean(age1), grade1=0, positive1=1, size1=mean(size1)   ) then I get Error in model.frame.default(Terms, newdata, ...) :   variable lengths differ (found for 'log(tstop + 1)') In addition: Warning message: 'newdata' had 1 rows

[R] pbc data

2009-07-13 Thread Λεωνίδας Μπαντής
Hi there, Can anyone please help me because I am going to get crazy with the pbc data set. I just want to apply simple cox regression in the data set. I am a beginner in R but I don't think I am doing anything wrong. I have the book of Fleming and Harrington 1990. I perform cox regression

[R] simple question beginner

2009-03-10 Thread Λεωνίδας Μπαντής
  Hi there,   I am beginner in R and I have some basic question. Suppose I run a common procedure such as a t test or cox model like below:   out-coxph( Surv(tstart,tstop, death1) ~ x1+x1:log(tstop+1) , test1,method=c(breslow))    Which yields the following result:   Call: coxph(formula =

[R] array manipulation simple questions

2009-02-23 Thread Λεωνίδας Μπαντής
  Hi there,   I am pretty new to R. Actually I started using it yesterday. I have two questions:   1.   Suppose I have a-c(1:10)  (or a-array(c(1:10),dim=c(1,10)))   and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to substitute alla elements that are 5 with 0 and 5 with 1.