[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-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] the Surv function

2007-05-01 Thread Jennifer Dillon
Hi,

I'm trying to do a simple survival analysis on some data, and I'm having the
following problem (here's my code and the error message):

out - Surv(fup,event=status)
Error in Surv(fup, event = status) : argument time2 is missing, with no
default

From reading the documentation, it seems that I 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-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[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 :
missing value where TRUE/FALSE needed


Thanks in advance!!

Jen

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.