Здравствуйте, гость ( Вход | Регистрация )
21.02.2012 - 23:27
Сообщение
#1
|
|
|
Группа: Пользователи Сообщений: 27 Регистрация: 5.02.2012 Пользователь №: 23464 |
Уважаемые форумчане!
Для анализа выживаемости строю модель Кокса, с разными независимыми переменными. И появилась необходимость сравнить модели. И собственно вопрос у меня к Вам - как сравнить что одна полученная модель лучше чем другая? |
|
|
![]() |
![]() |
![]() |
8.03.2012 - 11:49
Сообщение
#2
|
|
|
Группа: Пользователи Сообщений: 27 Регистрация: 5.02.2012 Пользователь №: 23464 |
Доброго времени суток, настали выходные и добрался до статистики:) Всех девушек и женщин форума с праздником!
Попробовал что Вы рекомендовали Выше, и пришел к такой модели: Код > model5<-coxph(Surv(day,event)~ efmss + gal + cys, data) > model5 Call: coxph(formula = Surv(day, event) ~ efmss + gal + cys, data = data) coef exp(coef) se(coef) z p efmss -3.75697 0.0234 1.13e+00 -3.32 0.00089 gal 0.09448 1.0991 1.05e-02 8.99 0.00000 cys 0.00019 1.0002 8.61e-05 2.20 0.02800 Likelihood ratio test=209 on 3 df, p=0 n= 197, number of events= 108 И теперь настала пора вернуться к самому первому вопросу:) как описать модель в виде функции. Нашел пока следующую информацию: http://www.medcalc.org/manual/cox_proportional_hazards.php Где указана понятная формула: ![]() pi прогностический индекс - ![]() но я не пойму где брать H0(t) в эту формулу? Если посмотреть существующие модели: 1)нева75: http://www.almazovcentre.ru/node/357 то там Н0(t) это базовый риск в момент времени t, и берут его с графика 2)сиэтлская модель: http://www.medmir.com/content/view/1727/61/ (англ вариант) ![]() то там Н0(t) = годы умноженные на коэффициент, равный 0,0405. Собственно вопрос пока таков: как мне получить базовую кумулятивную выживаемость Н0(t) исходя из собственных данных? |
|
|
![]() |
![]() |
8.03.2012 - 14:44
Сообщение
#3
|
|
|
Группа: Пользователи Сообщений: 1091 Регистрация: 26.08.2010 Пользователь №: 22699 |
Вот приличный мануал
http://cran.r-project.org/doc/contrib/Fox-...-regression.pdf по моему Вы пишете параметрическую модель, см. конец второй - начало третьей страницы. а так hazard (t) = density (t) / survivor (t) ха нашел еще ?basehaz This function exists primarily because users will look for the phrase 'baseline hazard' (often SAS converts looking for familiar keywords.) еще есть вот это Код > Similarly, when I do plot(zph), B(t) is fairly non-constant. > > This isn't inherently a problem for me. I don't need a hard single number > > to characterize the shape of the excess risk. However, I'd like to be > > able to say > > something qualitative about the shape of the excess risk for the predictor. > > E.g., is it linear, monotonically increasing, monotonially decreasing, etc. > > Is it safe to use the coxph diagnostic plot for this purpose? Basically - yes you can. There are a few caveats: 1. As a computational shortcut cox.zph assumes that var(X) is approximately constant over time, where X is the matrix of covariates. (Improving this has been on my to do list for some time). I have found this to be almost always true, but if you have a data set where e.g. everyone in treatment 1 is crossed over at 6 months, then you can get odd results for that covariate. I've run across 2-3 such data sets in 10+ years. 2. The spline curve on the plot is "for the eye". You can certainly use other smoothings, fit a line, etc. Often you can find a simpler fit. zpfit <- cox.zph(mycoxfit, transform='identity') plot(zpfit$x, zpfit$y[,1], xlab='Time') #look at variable 1 lines(lowess(zpfit$x, zpfit$y[,1]), col=2) abline( lm(zpfit$y[,1] ~zpfit$x), col=3) plot(zpfit$x, zpfit$y[,1], log='x') #same as transform=log etc. Sometimes the regression spline fit, the default for cox.zph, puts an extra "hook" on the end of the curve, somewhat like polynomials will. Terry T. Код -- begin included message ---
I am hoping for some advice regarding obtaining the values for the hazard function in a cox regression that I have undertaken. I have a model in the following form, analysed with the package survival (v. 2.34-1) and a log-log plot obtained using Design (v. 2.1-2). For two variables, the lines in the survival curves crossed. The statistician I been obtaining advice from (who does not use R) asked me to obtain the hazard function values. I am wanting to confirm whether basehaz is the correct command to obtain such values, to better understand what is occurring in the log plots. --- end inclusion ---- The best tool for understanding what is happening is cox.zph. cox.V <- coxph(Surv(intDaysUntilFVPO, Event_v) ~ intAgeAtMHCIndex + PRE + group + MHC + strGender, data = recidivismv) zpfit <- cox.zph(cox.V, transform='identity') plot( zpfitp[1]) #plot for the first variable plot( zpfitp[2]) #plot for the second You will get a plot of beta(t) versus time, a horizontal line corresponds to a constant hazard ratio. The Cox model coefficient is an "average" of the curve, e.g., the best horizontal line fit to it. Other than this, you can get the predicted cumulative hazard for any particular choice of covariates, the derivative of this = hazard and requires some form of smoothing. Terry Therneau Сообщение отредактировал p2004r - 8.03.2012 - 15:16 ![]() |
|
|
![]() |
![]() |
propedevt Как сравнить результаты регрессии Кокса 21.02.2012 - 23:27
propedevt Никто не знает как сравнить? 23.02.2012 - 08:14
DrgLena У вас была проблема, вы не знали формулу, хотя в д... 23.02.2012 - 11:24
propedevt Цитата(DrgLena @ 23.02.2012 - 11:24)... 23.02.2012 - 22:29
p2004r Цитата(propedevt @ 21.02.2012 - 23:2... 23.02.2012 - 17:50
propedevt Цитата(p2004r @ 23.02.2012 - 17:50) ... 23.02.2012 - 22:33
p2004r дубль 23.02.2012 - 18:01
propedevt Уважаемый p2004r!
Последовал Вашему совету и н... 3.03.2012 - 21:40
p2004r Цитата(propedevt @ 3.03.2012 - 21:40... 4.03.2012 - 12:54
propedevt Посмотрел, нашел что AIC ? информационный критерий... 4.03.2012 - 14:24
p2004r Цитата(propedevt @ 4.03.2012 - 14:24... 4.03.2012 - 18:31
propedevt Цитата(p2004r @ 8.03.2012 - 14:44) В... 8.03.2012 - 15:24
DrgLena ... 8.03.2012 - 18:13
propedevt Просто средние ковариат? тогда вот они:
gal 25,234... 8.03.2012 - 21:10
DrgLena ... 8.03.2012 - 22:27
propedevt Цитата(DrgLena @ 8.03.2012 - 22:27) ... 8.03.2012 - 23:09
DrgLena Вы сами выбираете единицу измерения времени, в зав... 9.03.2012 - 01:00
propedevt Вычитал даты и получал дни жизни (до 805 дней макс... 9.03.2012 - 08:15
propedevt Уважаемый p2004r, прошу меня извинить, но не сразу... 9.03.2012 - 10:04
p2004r Цитата(propedevt @ 9.03.2012 - 10:04... 9.03.2012 - 11:25
DrgLena ... 9.03.2012 - 10:59
propedevt Да понял, что если риск 0,8 то выживаемость 0,2
Гр... 9.03.2012 - 11:29
DrgLena Цитата(propedevt @ 9.03.2012 - 11:29... 9.03.2012 - 11:56
DrgLena Закат солнца в ручную у меня не получается с таким... 9.03.2012 - 12:32
p2004r Цитата(DrgLena @ 9.03.2012 - 12:32) ... 9.03.2012 - 13:24
DrgLena ... 9.03.2012 - 13:41
propedevt Что-то Вы меня совсем запутали:( перечитал что мне... 9.03.2012 - 14:04
p2004r Цитата(propedevt @ 9.03.2012 - 14:04... 9.03.2012 - 14:14
propedevt Хорошо, файл прикрепил. В последней модели использ... 9.03.2012 - 14:40
p2004r Цитата(propedevt @ 9.03.2012 - 14:40... 9.03.2012 - 17:15
propedevt Да, до predict все делал точно также 9.03.2012 - 17:18
p2004r Теперь basehazard и счет на прямую. Центрированная... 9.03.2012 - 17:43
p2004r Код> exp(model5$linear.predictors... 9.03.2012 - 18:36
propedevt Цитата(p2004r @ 9.03.2012 - 18:36) К... 9.03.2012 - 18:49
p2004r Линейный предиктор он считает в момент фита
name... 9.03.2012 - 19:19
p2004r Конкретно в этой модели первая переменная похоже н... 9.03.2012 - 19:42

propedevt Цитата(p2004r @ 9.03.2012 - 19:42) К... 9.03.2012 - 20:35

p2004r Цитата(propedevt @ 9.03.2012 - 20:35... 9.03.2012 - 21:59
propedevt Цитата(p2004r @ 9.03.2012 - 19:19) Л... 9.03.2012 - 20:26
p2004r Цитата(propedevt @ 9.03.2012 - 20:26... 9.03.2012 - 22:33
propedevt Действия математические понятны. Но каков смысл pr... 9.03.2012 - 17:58
propedevt давайте уберем ее из модели, построим только на ga... 9.03.2012 - 22:01
propedevt Так понятно, но я вижу predict не используется же ... 9.03.2012 - 22:39
propedevt Итак хочу написать в математических операциях.
нач... 9.03.2012 - 23:23
p2004r Цитата(propedevt @ 9.03.2012 - 23:23... 10.03.2012 - 11:17
propedevt Т.к. убрал из модели efmss, добавил в нее возраст.... 10.03.2012 - 13:43
p2004r Цитата(propedevt @ 10.03.2012 - 13:4... 10.03.2012 - 21:06![]() ![]() |