[R] get the rows so that there is no redundant element in a certain column

2010-10-28 Thread boshao zhang
Dear everyone in the Mailing list:   It is easy to get the unique elements in a column. But I would like to get rid of those rows that the elements of this column are redundant. Or sometimes, to have a look at the rows that the elements of this column are redundant is also important. I guess it

[R] help needed to find zero areas in a vector

2010-01-11 Thread boshao zhang
Dear Helpers:   I spend more than half a day to solve this problem in R:   Let x be a vector of a string of 0s and 1s, such as x<-c(0,0,1,1,0,0,0,0,1,1,0,0,0,0). It can be a very long vector. How to sub vectors of 0s? In the above example, I would like get the vectors (0,0), (0,0,0,0), (0,0,0,0).

[R] weibull model

2008-03-19 Thread boshao zhang
Dear Helpers: If you know how to fit a Weibull model using R, you are my savior for my project. The hazard ramda is specified as t^alpha * (1+a*dose*exp(-b*dose)). Or, can we modify the Cox model to capture the proportional part above? Here t is the survial time, dose is a subject received in a ex

[R] pass lm( ) a char vector as the variables to be included

2007-11-26 Thread boshao zhang
Dear Everyone in list: I am writing some codes to automate the process of fitting linear models where the names of variables of models are produced and stored in character vectors. But I have problems to pass the vectors to the lm( ) because I don't know how to strip the quotation marks automatical