ST227 PROJECT MOCK PAPER.
生存模型代写 Question 2. This questions is divided into parts. Both parts use the same data set of fully observed lifetimes given below: 64 75 29 45 67 65 77 90
Question 1.
The lifetime of a mechanical system is modelled by the following mortality intensity1 :
µ(t) ≡ λ, t ≥ 0, λ = 10−1.
(1) Define in R the survival probability function (t, x) → tpx and calculate the probability of surviving the next 5 years for a 15-year-old system.2
(a) Define in R the density function for T15. This definition may involve a numerical integral.
(b) Calculate the expected remaining lifetime for this individual.
(c) Define in R the cumulative distribution function of T15. This definition may involve a numerical integral. Discuss how you would find the 95-th percentile of T15.3
1 Of course, machines are not ”mortal”. In engineering, this is referred to equivalently as the hazard function. We shall refer to it as mortality intensity, though, to avoid unnecessary jargon.
2 I am aware that this can be computed explicitly by hand. This is for your R practice, however.
3 That is, a value α such that P(T15 ≤ α) = 0.95.
Question 2. 生存模型代写
This questions is divided into parts. Both parts use the same data set of fully observed lifetimes given below:
64 75 29 45 67 65 77 90 65 55
80 67 72 46 64 28 68 75 49 94
(2) We propose a lifetime model with the following mortality intensity function:
µ(t) = α × λα × tα−1 , t ≥ 0.
(a) Derive algebraically the probability density function for lifetime and write down the joint-likelihood of the given sample.
(b) Using the optim method in R, numerically obtain the maximum likelihood estimators of the model parameters.4
4 You may have to play around with the initial parameters a bit. This model is quite stable, meaning you don’t need very good initial parameters for it to converge.
Question 3. 生存模型代写
Cancer patients who are in remission are observed and the number of days until the symptoms reappear is recorded.5 Some records have been right-censored. The data set is provided in a spreadsheet named cancer.xlsx and the columns therein are:
- time: the time until reappearance of symptoms in number of days.
- event: an indicator variable taking value 0 if the record has beenright-censored and 1 if fully observed.
- fullyObserved: logical variable indicating whether the record has been fully observed.
- sex: categorical variable with value 0 for male (the reference group) and1 for female.
5 What if a patient is completely cured of cancer? We will need a model that allows for T = ∞. For the purpose of this exercise, though, we will ignore this subtlety and proceed as usual.
Question 4. 生存模型代写
In this question, we will fit a Cox Proportional Hazard model on the same data set in Question 3, with time as the response variable and sex as the categorical covariate.
(1) By using the survival package or otherwise, calculate the MLE for the Cox Proportional Hazard Model.
(2) Based on the output you have generated, perform the z-test, Score test, and Likelihood Ratio test on the following hypotheses:
H0 : β = 0, vs H1 : β ≠ 0.