当前位置:天才代写 > R语言代写,r语言代做-无限次修改 > 生存模型代写 ST227代写 数学统计代写

生存模型代写 ST227代写 数学统计代写

2022-09-05 15:00 星期一 所属: R语言代写,r语言代做-无限次修改 浏览:613

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, λ = 101.

(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.

 

生存模型代写
生存模型代写

 

 

更多代写:人工智能代写  toefl在家考  管理学英国代写   essay代写价格  加拿大paper代写  Summary代写

合作平台:essay代写 论文代写 写手招聘 英国留学生代写

 

天才代写-代写联系方式