Publications by Zhao Yuanfan
Assignment 5 of Survival Analysis: Question 3
Question 3 We import the required data set. prostateCancerSub <- read.csv("prostateCancerSub.csv") prostateCancerSub %>% head() %>% kable() Time Status Trt Stage hx hg sz Age 72 alive 0.2 mg estrogen 3 0 13.79883 2 75 1 dead - other ca 0.2 mg estrogen 3 0 14.59961 42 54 40 dead - cerebrovascular 5.0 mg estrogen 3 1 13.39844 3 69 20 dead - cer...
1969 sym 2 img 1 tbl
Assignment 5 of Survival Analysis: Question 4
Question 4 Question 4.2 According to the question, we generate the survival times \(\tilde{t}_{ij}\) as follows: set.seed(1220) n <- 2000 ni <- sample(2:4, n, replace = TRUE) N <- sum(ni) X1 <- runif(N) X2 <- rgamma(n, 0.5, 0.5) %>% log() %>% rep(time = ni) u <- runif(N) t <- sqrt(-log(1-u) / exp(-2 * X1 + X2)) c <- runif(N, 3, 6) delta ...
1463 sym
Assignment 5 of Survival Analysis: Question 3
Question 3 We import the required data set. prostateCancerSub <- read.csv("prostateCancerSub.csv") prostateCancerSub %>% head() %>% kable() Time Status Trt Stage hx hg sz Age 72 alive 0.2 mg estrogen 3 0 13.79883 2 75 1 dead - other ca 0.2 mg estrogen 3 0 14.59961 42 54 40 dead - cerebrovascular 5.0 mg estrogen 3 1 13.39844 3 69 20 dead - cer...
1968 sym 2 img 1 tbl
Assignment 4 of Survival Analysis: Question 4
Question 4 We import the required data set. kidneyTrans <- read.csv("kidneyTrans.csv") kidneyTrans <- kidneyTrans %>% filter(age >= 35) kidneyTrans %>% head() %>% kable() obs time death gender race age 1 1 0 1 1 46 2 5 0 1 1 51 3 7 1 1 1 55 4 9 0 1 1 57 5 13 0 1 1 45 6 13 0 1 1 43 We find that there are 863 observations. The meanings of e...
3104 sym 7 img 2 tbl
Assignment 4 of Survival Analysis: Question 5
Question 5 We import the required data set. TdapVaccine <- read.csv("TdapVaccine.csv") TdapVaccine <- TdapVaccine[, 2:4] TdapVaccine %>% head() %>% kable() Delivery Vac tVac 36.1 1 35.3 37.0 1 36.8 38.6 1 33.8 41.3 0 NA 35.6 0 NA 41.2 0 NA We find that there are 1000 observations. The meanings of each variable are as follows: Delivery me...
1742 sym 1 tbl
Assignment 4 of Survival Analysis: Question 4
Question 4 We import the required data set. kidneyTrans <- read.csv("kidneyTrans.csv") kidneyTrans <- kidneyTrans %>% filter(age >= 35) kidneyTrans %>% head() %>% kable() obs time death gender race age 1 1 0 1 1 46 2 5 0 1 1 51 3 7 1 1 1 55 4 9 0 1 1 57 5 13 0 1 1 45 6 13 0 1 1 43 We find that there are 863 observations. The meanings of e...
3103 sym 7 img 2 tbl
Assignment 3 of Survival Analysis: Question 3
Question 3 We import the required data set. prostateCancerSub <- read.csv("prostateCancerSub.csv") prostateCancerSub %>% head() %>% kable() Time Status Trt Stage hx hg sz Age 72 alive 0.2 mg estrogen 3 0 13.79883 2 75 1 dead - other ca 0.2 mg estrogen 3 0 14.59961 42 54 40 dead - cerebrovascular 5.0 mg estrogen 3 1 13.39844 3 69 20 dead - cer...
4717 sym 3 img 3 tbl
Assignment 3 of Survival Analysis: Question 4
Question 4 Question 4.1 We test the PH assumption on variable hg, sz and Age for model 7. The output is as follows: cox.zph(model7, terms = FALSE) ## chisq df p ## Trt0.2 mg estrogen 0.913 1 0.339 ## Trt1.0 mg estrogen 2.652 1 0.103 ## Trt5.0 mg estrogen 0.054 1 0.816 ## I(Stage == 4)TRUE 0.974 1 0.324 ## I(hx ==...
2015 sym Python (6922 sym/14 pcs) 8 img
Assignment 2 of Survival Analysis: Question 5
Question 5 We import the required data set. kidneyTrans <- read.csv("kidneyTrans.csv") kidneyTrans %>% head() %>% kable() obs time death gender race age 1 1 0 1 1 46 2 5 0 1 1 51 3 7 1 1 1 55 4 9 0 1 1 57 5 13 0 1 1 45 6 13 0 1 1 43 According to the question, we know there are 863 observations. The meanings of each variable are as follows...
3327 sym 1 img 1 tbl
Assignment 2 of Survival Analysis: Question 6
Question 6 We import the required data set. larynxCancer <- read.csv("larynxCancer.csv") larynxCancer %>% head() %>% kable() stage time age year death 1 0.6 77 76 1 1 1.3 53 71 1 1 2.4 45 71 1 1 2.5 57 78 0 1 3.2 58 74 1 1 3.2 51 77 0 According to the question, we know there are 90 observations. The meanings of each variable are as follow...
3599 sym 1 tbl