7.4 In section 1.11, data from a study of the effect of ploidy on survival for patients with tumors of the tongue was reported.
(a) Test the hypothesis that the survival rates of patients with cancer of the tongue are the same for patients with aneuploid and diploid tumors using the log-rank test.

h1(t): survival rates of patients with cancer of the tongue (aneuploid tumor)
h2(t): survival rates of patients with cancer of the tongue (diploid tumor)

H0: h1(t) = h2(t) Ha: not H0

test statistic: Drawing

Under H0, the test statistics follows a chi-square distribution. We estimate test statistics by using weight function W(t)=1.

## Loading required package: splines
## Call:
## survdiff(formula = Surv(time, delta) ~ factor(type), rho = 0)
## 
##                 N Observed Expected (O-E)^2/E (O-E)^2/V
## factor(type)=1 52       31     36.6     0.843      2.79
## factor(type)=2 28       22     16.4     1.873      2.79
## 
##  Chisq= 2.8  on 1 degrees of freedom, p= 0.0949

The value of the test statistic is 2.8 and the p-value is 0.0949, so we can not reject the null hypothesis that the survival rates of patients with cancer of the tongue are the same for patients with aneuploid and diploid tumors.

(b) If primary interest is in detecting differences in survival rates between the two types of cancers which occur soon after the diagnosis of the cancer, repeat part a using a more appropriate test statistic.

We can use Peto & Peto test in this problem, because it gives a heavier weight on earlier time. We can replace the weight function in (a) by Drawing, then do the same calculation.

## Call:
## survdiff(formula = Surv(time, delta) ~ factor(type), rho = 1)
## 
##                 N Observed Expected (O-E)^2/E (O-E)^2/V
## factor(type)=1 52     20.2     24.4     0.731       3.3
## factor(type)=2 28     15.1     10.9     1.643       3.3
## 
##  Chisq= 3.3  on 1 degrees of freedom, p= 0.0694

The test statistic is equal to 3.3 and the p-value is 0.0694. We also can not reject the null hypothesis.

(c) Before choosing the weight function in (b), plot the weight functions listed in Table 7.3 of the text versus time, and for part (b) choose the one that best meets the stated criterion.

(d) Perform the Renyi-type tests for both choices of weight functions from (a) and (b).

H0: h1(t) = h2(t) Ha: not H0

test statistic: Drawing

Under H0, the test statistics can be approximate by sup(|B(x)|, 0<=x<=1), where B(x) has a standard Brownian motion process.

Drawing

The value of Renyi type test statistics is 1.79, which gives a p-value of 0.15. The null hypothesis is not rejected and h1(t) = h2(t)

Drawing

We get Renyi test statistics with value of 2.03 and p-value 0.08, which also can not reject the null hypothesis. There is no difference between two hazard function.

7.8 In Example 7.4, we compared the disease-free survival rates of ALL patients with those of high-risk and low risk AML patients. Because acute graft-versus-host (aGVHD) disease is considered to have an antileukemic effect, one would expect lower relapse rates for patients who have developed aGVHD than for those that do not develop aGVHD. Using the data on our web page, examine the validity of this finding by (Use log-rank tests)
(a) testing if the hazard rate for the occurrence of aGVHD is the same for the three groups,

H0: the hazard rate for the three groups are same Ha: the hazard rate for the three groups are not same

test statistics: Drawing

Under H0, the test statistics follows a chi-square distribution. We use log rank weight function W(t)=1.

## Call:
## survdiff(formula = Surv(ta, da) ~ factor(group), data = bmt, 
##     rho = 0)
## 
##                  N Observed Expected (O-E)^2/E (O-E)^2/V
## factor(group)=1 38        9     7.42     0.336     0.472
## factor(group)=2 54       11     9.90     0.121     0.197
## factor(group)=3 45        6     8.67     0.825     1.244
## 
##  Chisq= 1.3  on 2 degrees of freedom, p= 0.525

The result of chi-square is 10.4, and p-value is 0.00564, Which indicates the null hypothesis is rejected. The hazard rate for the three groups are not same

(b) testing if the hazard rate for relapse is the same in all three groups, and

H0: the hazard rate for the three groups are same Ha: the hazard rate for the three groups are not same

test statistics: Drawing

Under H0, the test statistics follows a chi-square distribution.

## Call:
## survdiff(formula = Surv(t2, d2) ~ factor(group), data = bmt, 
##     rho = 0)
## 
##                  N Observed Expected (O-E)^2/E (O-E)^2/V
## factor(group)=1 38       12     11.2    0.0625    0.0854
## factor(group)=2 54        9     20.2    6.1851   12.0778
## factor(group)=3 45       21     10.7   10.0122   13.5301
## 
##  Chisq= 16.5  on 2 degrees of freedom, p= 0.000263

Chi-square is equal t0 16.5, p-value is 0.000263. The null hypothesis is rejected. There is a strong evidence that the hazard rate for the three groups are not same.

(c) testing if the hazard rate for relapse in the three disease groups is the same for patients who have developed aGVHD. (Hint: For this test, the data is left-truncated at the time of aGVHD).

H0: the hazard rate of replase for the three groups who developed aGVHD are same Ha: the hazard rate of replase for the three groups who developed aGVHD are not same

test statistics: Drawing

Under H0, the test statistics follows a chi-square distribution.

## Call:
## survdiff(formula = Surv(t2, d2) ~ factor(group), data = subset(bmt, 
##     da == 1), rho = 0)
## 
##                  N Observed Expected (O-E)^2/E (O-E)^2/V
## factor(group)=1  9        2    1.972  0.000411  0.000684
## factor(group)=2 11        1    2.450  0.858469  1.696685
## factor(group)=3  6        2    0.578  3.497169  3.976827
## 
##  Chisq= 4.4  on 2 degrees of freedom, p= 0.112

We get a chi-square value of 0.7 and p-value 0.714, the null hypothesis is not rejected.The hazard rate of replase for the three groups who developed aGVHD are same