![]() |
Здравствуйте, гость ( Вход | Регистрация )
![]() |
![]()
Сообщение
#1
|
|
Группа: Пользователи Сообщений: 27 Регистрация: 5.02.2012 Пользователь №: 23464 ![]() |
Уважаемые форумчане!
Для анализа выживаемости строю модель Кокса, с разными независимыми переменными. И появилась необходимость сравнить модели. И собственно вопрос у меня к Вам - как сравнить что одна полученная модель лучше чем другая? |
|
![]() |
![]() |
![]() |
![]()
Сообщение
#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) исходя из собственных данных? |
|
![]() |
![]() |
![]()
Сообщение
#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 ![]() |
|
![]() |
![]() |
![]()
Сообщение
#4
|
|
Группа: Пользователи Сообщений: 27 Регистрация: 5.02.2012 Пользователь №: 23464 ![]() |
Вот приличный мануал http://cran.r-project.org/doc/contrib/Fox-...-regression.pdf по моему Вы пишете параметрическую модель, см. конец второй - начало третьей страницы. а так hazard (t) = density (t) / survivor (t) Этот файлик смотрел в самом начале, когда начал кокса строить в R.. сейчас снова посмотрел, и все равно не понял как вычислить h0(t) Код который сейчас добавили сейчас опробую) |
|
![]() |
![]() |
![]() ![]() |