[R] making an inicator variable

2005-10-25 Thread Jennifer Dillon
Hello, I am almost a total novice, and I am sure there must be an easy (and basic) way to turn a variable of 1's and 2's into a variable of zeros and ones. This is in a data frame, but if I could do it with vectors, that's all I need. Can someone tell me how? Thanks so much, Jen

[R] the Surv function

2007-05-01 Thread Jennifer Dillon
should be able to simply write: Surv(time1, event) if my data is right-censored, which it is. Help! Thanks a million, Jen -- Jennifer Dillon Doctoral Student Harvard Biostatistics Room 414B, Building 1 [[alternative HTML version deleted

[R] the ifelse function

2007-05-05 Thread Jennifer Dillon
Hi Everyone, I think I found a problem with the ifelse function: If the condition argument is NA, it treats it as true. Anyone agree or disagree with this? Jen -- Jennifer Dillon Doctoral Student Harvard Biostatistics Room 414B, Building 1 [[alternative HTML version deleted

[R] kde2d error message

2007-08-10 Thread Jennifer Dillon
Hello! I am trying to do a smooth with the kde2d function, and I'm getting an error message about NAs. Does anyone have any suggestions? Does this function not do well with NAs in general? fit - kde2d(X, Y, n=100,lims=c(range(X),range(Y))) Error in if (from == to || length.out 2) by - 1 :