log-rank test in R I need to use the survdiff function to statistically compare (using log-rank test) the following survival functions:
(1) Male (Sex=1) and Female (Sex=2)
(2) Patients <= 65 years-old and Patients > 65 years-old  
I used the following command 
Male <- survdiff(Surv(time,Status)~sex==1,data=myeloma)
Female <- survdiff(Surv(time,Status)~sex==2,data=myeloma)

is that correct ?
 A: The examples provided in ?survdiff are pretty clear. Using some example data included in survival, this
survdiff(Surv(futime, fustat) ~ rx,data=ovarian)

Is testing for a difference in survival between individuals with rx = 1 and rx = 2. For your data, this will compare survival for males versus females
survdiff(Surv(time, Status) ~ sex, data=myeloma)

And this will compare survival for <= 65 versus >65.
survdiff(Surv(time, Status) ~ age, data=myeloma)

A: It doesn't look right. If you want to limit the analysis to just males or females, the sex==1 or sex==2 is a separate input, the subset clause. The new commands would be
Males<-survdiff(surv(time,Status)~Patients, data = myeloma, sex==1)

Females<-survdiff(surv(time,Status)~Patients, data = myeloma, sex==2)

You need to specify something as the dependent variable in the equation, and the only remaing variable is Patients.
If you actually want to measure the effects of both sex and age together on survival, you need to be doing a stratified log rank test. I've used the function SurvTest(in documentation)/surv_test from the coin package.
As far as I could tell, it only takes one stratifying variable, but I came up with a workaround by appending several variables into a new variable and using that as the stratifying variable.
There are a couple of other packages that can do the same thing, but I can't think of them right now.
