代写MATH2775 Survival Analysis Homework 3代写留学生Matlab程序

MATH2775 Survival Analysis

Homework 3

Deadline and Submission

Submission Deadline: 14:00 Friday 9th May 2025

Submit: You will need to submit via GradeScope on Minerva

Homework: Each homework (there are 3 in total) is worth 5% of your final module mark

Presentation: You need to submit your homework as a single PDF file. You are strongly encouraged to use RMarkdown and Latex for editing. Handwritten and scanned homework is also fine, but it has to be clear and tidy, and clearly scanned.  Do not write in very small font if you submit handwritten scanned work. Be aware that when you upload the scanned file to GradeScope the visual clarity can be reduced.

Marking Information

Each exercise part (e.g. 2a) will be marked out of 3, with the following criteria:

•  3 marks for an almost perfect answer.

•  2 marks if there are small flaws, serious enough that you should look at the solutions.

•  1 mark if there are major flaws, serious enough that you really need to look back at the lecture notes.

0 marks for an overall poor attempt.

The simplicity of this marking scheme has two advantages: you will immediately

know how to react to your marks (e.g. if you get 1 mark then you need to look at the relevant notes), and it makes the marking faster so that you will receive your feedback sooner. The total marks available from the exercises on each homework will be 24. An additional 1 mark will be awarded if your work is nicely presented.

For any exercises that require the use of R, please provide both your code and the  output in your answer. If your submission is scanned handwritten work. I suggest  that for questions involving R then you cut-and-paste commented/annotated code  and any output (including plots) into, e.g., Word. You should then add some short text to explain/describe the R code/output. You can then print that off (attaching it to any handwritten work).

Downloading data

You will also need to download the two datasets accompanying this homework:

• prostate . Rdata - when you load this into R you will create a dataframe called prostate

• phone . Rdata - when you load this into R you will create a dataframe called phone

You will need to save these two  . Rdata files in the working directory of R so that it can find them. Please carefully read (and run) the KMAnalysis . R example on

MINERVA under “R Code and Datasets → Kaplan Meier” to explain how this is done if you are unsure.

HOMEWORK 3

Exercise 1

Which of the following classes of distributions have the proportional hazards property?

•  Gompertz: h(t) = λeθt  with parameters λ > 0 and θ ∈ R.

Makeham: h(t) = γ + λe-θt  with parameters γ > 0, λ ≥ -γ and θ 0.

•  Bathtub: h(t) = αt + 1+γt/β with parameters γ ≥ 0, α ≥ 0 and β > 0.

Explain your answers as clearly as possible (no marks will be given for answers without explanation).

Exercise 2

The data in the file prostate . Rdata have been adapted from Andrews and Herzberg  (1985) and give results of a trial on treatments for prostate cancer. Various covariates were recorded. The variables in the data file are given below:

Variable

Description

Levels

time

Time to Death/censoring

censor

indicator variable

0 = Right-censored

1 = Death

rx

Treatment Groups

Placebo

0.2

1.0

5.0

mg

mg

mg

Estrogen

Estrogen

Estrogen

stage

Stage of Disease

3 = No evidence of distant metastasis

4 = Evidence of distant metastasis

age

Age of Patient

weight

Weight Index

Weight (kg) - Height (cm) + 200

Table 1:  Variables measured on prostate cancer in prostate . Rdata by Andrews and Herzberg (1985)

a)  Using R, show (on the same plot) the KM estimate for each treatment group (Lectures 7 and 8). Comment on what you see.

b)  Using R, fit a Cox proportional hazards model (Lectures 14 and 15) including all the variables (so you take account of all the variables measured on the subjects).

c)  Comment on the effect of the various variables, and whether treatment makes a significant difference on survival.

Exercise 3

A consumer review group is testing the lifetimes of two types of mobile phone.  The data can be found in phone . Rdata. The variables are:

Variable

Description

Levels

time

Time to Failure/Censoring

status

indicator variable

0 = Right-censored

1 = Failure

group

Type of Phone

Group A

Group B

Table 2: Mobile phone testing in phone . Rdata

a)  Using R, plot KM estimates for each group (on same plot). By considering a

suitable transformation of the KM estimates (see Lectures 9 and 10) provide a visual assessment of whether it is reasonable to model the lifetimes in each group by Exponential random variables Exp(λA ) and Exp(λB ) respectively.

b)  Using R, under the assumption that it is reasonable to model the lifetimes in each group by Exponential distributions, provide the MLE estimates for the  rates λA  and λB ; and consequently estimate the expected phone lifetimes for each group μA  and μB .

Note: You should do this in R (rather than by hand) by, e.g.,

Splitting the data.frame into two, for example GroupA_phone and GroupB_phone

Using methods of Chapter 4.3 (Lectures 9 and 10) to find MLE (along with sum() function) for each group

c)  Using R, perform a log-rank test (Lectures 7 and 8) to see if there is a

statistically significant difference between the two groups

d) Using R, fit an AFT model using an exponential distribution:

>  load("phone. Rdata")

>  #  NOTE: You will probably have  already  loaded  the  data  to  answer  above

>

>  #  Now perform  a  AFT  model

> phone_AFT_fit  <- survreg(Surv(time, status) ~ group,

+                              data  =  phone,

+                              dist=  "exponential")

>  summary(phone_AFT_fit)

Does this parametric test suggest there is a different in lifetimes between the groups? Compare the estimates obtained for λA  and λB  by the AFT model with your answers for part b).




热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图