Workshop frailty models Luc Duchateau, Rosemary Nguti and Paul Janssen.

Slides:



Advertisements
Similar presentations
Likelihood & Hierarchical Models  ij  j,  j 2   j ,  2 
Advertisements

How Should We Assess the Fit of Rasch-Type Models? Approximating the Power of Goodness-of-fit Statistics in Categorical Data Analysis Alberto Maydeu-Olivares.
PTP 560 Research Methods Week 9 Thomas Ruediger, PT.
3. Binary Choice – Inference. Hypothesis Testing in Binary Choice Models.
Workshop 1 Alternative models for clustered survival data.
Chi-Squared Distribution Leadership in Engineering
Statistics 350 Lecture 14. Today Last Day: Matrix results and Chapter 5 Today: More matrix results and Chapter 5 Please read Chapter 5.
Descriptive statistics Experiment  Data  Sample Statistics Experiment  Data  Sample Statistics Sample mean Sample mean Sample variance Sample variance.
Chapter 11 Survival Analysis Part 2. 2 Survival Analysis and Regression Combine lots of information Combine lots of information Look at several variables.
STAT262: Lecture 5 (Ratio estimation)
Multivariate Survival Analysis Alternative approaches Prof. L. Duchateau Ghent University.
Workshop Semiparametric frailty models
Modeling clustered survival data The different approaches.
Accelerated Failure Time (AFT) Model As An Alternative to Cox Model
Hypothesis Testing Using The One-Sample t-Test
Chapter 7 Inferences Regarding Population Variances.
17. Duration Modeling. Modeling Duration Time until retirement Time until business failure Time until exercise of a warranty Length of an unemployment.
The Chi-square Statistic. Goodness of fit 0 This test is used to decide whether there is any difference between the observed (experimental) value and.
Difference Two Groups 1. Content Experimental Research Methods: Prospective Randomization, Manipulation Control Research designs Validity Construct Internal.
Multivariate survival analysis Luc Duchateau, Ghent University Paul Janssen, Hasselt University 1.
- Interfering factors in the comparison of two sample means using unpaired samples may inflate the pooled estimate of variance of test results. - It is.
Statistics for Engineer Week II and Week III: Random Variables and Probability Distribution.
Multivariate Survival Analysis Prof. L. Duchateau Ghent University.
Chapter 9: Non-parametric Tests n Parametric vs Non-parametric n Chi-Square –1 way –2 way.
The Scientific Method Probability and Inferential Statistics.
Lecture 13: Cox PHM Part II Basic Cox Model Parameter Estimation Hypothesis Testing.
Part 2: Model and Inference 2-1/49 Regression Models Professor William Greene Stern School of Business IOMS Department Department of Economics.
Lecture 19: Competing Risk Regression
Sequential sums of squares … or … extra sums of squares.
Chi-Square Test James A. Pershing, Ph.D. Indiana University.
Workshop 2 Frailty models. Contents Inference for shared gamma frailty models –Theoretical considerations –Fitting parametric and semiparametric models.
Lecture 12: Cox Proportional Hazards Model
Lecture 16: Regression Diagnostics I Proportional Hazards Assumption -graphical methods -regression methods.
Lecture 3: Statistics Review I Date: 9/3/02  Distributions  Likelihood  Hypothesis tests.
Kruskal-Wallis H TestThe Kruskal-Wallis H Test is a nonparametric procedure that can be used to compare more than two populations in a completely randomized.
Inferences Concerning Variances
Multilevel and multifrailty models. Overview  Multifrailty versus multilevel Only one cluster, two frailties in cluster e.g., prognostic index (PI) analysis,
Lecture 3: Parametric Survival Modeling
Inference for the mean vector. Univariate Inference Let x 1, x 2, …, x n denote a sample of n from the normal distribution with mean  and variance 
Introduction to Frailty Models
Logistic regression (when you have a binary response variable)
Lecture 3: MLE, Bayes Learning, and Maximum Entropy
Regression through the origin
Section 6.4 Inferences for Variances. Chi-square probability densities.
MATB344 Applied Statistics I. Experimental Designs for Small Samples II. Statistical Tests of Significance III. Small Sample Test Statistics Chapter 10.
1 Borgan and Henderson: Event History Methodology Lancaster, September 2006 Session 6.1: Recurrent event data Intensity processes and rate functions Robust.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
Chi Square Test for Goodness of Fit Determining if our sample fits the way it should be.
1 STAT 500 – Statistics for Managers STAT 500 Statistics for Managers.
A framework for multiple imputation & clustering -Mainly basic idea for imputation- Tokei Benkyokai 2013/10/28 T. Kawaguchi 1.
R Programming/ Binomial Models Shinichiro Suna. Binomial Models In binomial model, we have one outcome which is binary and a set of explanatory variables.
Density Estimation in R Ha Le and Nikolaos Sarafianos COSC 7362 – Advanced Machine Learning Professor: Dr. Christoph F. Eick 1.
Statistical principles: the normal distribution and methods of testing Or, “Explaining the arrangement of things”
Institute of Statistics and Decision Sciences In Defense of a Dissertation Submitted for the Degree of Doctor of Philosophy 26 July 2005 Regression Model.
[Topic 11-Duration Models] 1/ Duration Modeling.
Canadian Bioinformatics Workshops
Jacek Wallusch _________________________________ Statistics for International Business Lecture 8: Distributions and Densities.
Theme 8. Major probability distributions
Unit 8 Section 7.5.
Math 4030 – 10b Inferences Concerning Variances: Hypothesis Testing
Inference for the mean vector
STAT 5372: Experimental Statistics
More about Posterior Distributions
The parametric frailty model workshop
Chapter 7 Minitab Recipe Cards
Statistical Process Control
Basics of the semiparametric frailty model
Inferences Regarding Population Variances
1/2555 สมศักดิ์ ศิวดำรงพงศ์
Probabilistic Surrogate Models
Presentation transcript:

Workshop frailty models Luc Duchateau, Rosemary Nguti and Paul Janssen

Contents The statistical package R The data set: time to first insemination Inference for shared gamma frailty models –Theoretical considerations –Fitting parametric and semiparametric models More flexible shared gamma frailty models –Time-varying covariates –Smoothing splines Other approaches for frailty models –Choice of the frailty density –A Bayesian approach for frailty models

The statistical package R Freeware (unlike Splus) Powerful statistical package Data handling a bit less powerful Downloadable from the Internet –Base –Libraries From within R Download library yourself

Installing R via Internet Go to Choose option download Choose closest mirrorsite Choose operating system Windows (95 and later) Choose subdirectory base Choose rw1090.exe

Installing additional packages Automatically within R –Menu item « Packages» « Install Packages from CRAN … » Choose « survival » –New session, specify « library(survival) » Download zipped package from CRAN –Unzip it under directory « c:\Program Files\R\rw1091\library »

The data set: Time to first insemination Database of regional Dairy Herd Improvement Association (DHIA) –Milk recording service –Artificial insemination –Select sample –Subset of 2567 cows from 49 dairy farms

Fixed covariates data set insemfix.dat

Time-varying covariates data set insemtvc.dat

Fitting parametric frailty models (1) Read the data –insemfix<-read.table("c://insemfix.dat",header=T) Create vectors heifer<- herd stat timeto insem$heifer

Fitting parametric frailty models (2) Derive quantities n, Di and e –n<-length(levels(as.factor(herd)) 49 –Di<-aggregate(stat,by=list(herd),FUN=sum)[,2] –e<-sum(Di) … … 34

Fitting parametric frailty models (3) Observable likelihood for constant hazard

Fitting parametric frailty models (4) Calculate observable likelihood for parameters –h=1/p[1],  =1/p[2],  =p[3] Cumulative hazard Hazard Timeto*exp(heifer*p[3])/p [1] cumhaz aggregate(cumhaz,by=list(herd),FUN=sum)[,2]cumhaz stat*log(exp(heifer*p[3])/p [1])) lnhaz aggregate(lnhaz,by=list(herd),FUN=sum)[,2]lnhaz

Fitting parametric frailty models (5) likelihood.exponential<-function(p){ cumhaz<-(timeto*exp(heifer*p[3]))/p[1] cumhaz<-aggregate(cumhaz,by=list(herd),FUN=sum)[,2] lnhaz<-stat*log(exp(heifer*p[3])/p[1]) lnhaz<-aggregate(lnhaz,by=list(herd),FUN=sum)[,2] lik<-e*log(1/p[2])-n*log(gamma(p[2]))+sum(log(gamma(Di+p[2])))- sum((Di+p[2])*log(1+cumhaz/p[2]))+sum(lnhaz) -lik}

Fitting parametric frailty models (6) initial<-c(100,17,0) t<-nlm(likelihood.exponential,initial,print.level=2) h<-1/t$estimate[1] h theta<-1/t$estimate[2] theta beta<-t$estimate[3] beta

Interpretation  From , the heterogeneity parameter, to density for median time to event calcm<-function(m){ (log(2)/(theta*h))^(1/theta) *(1/m)^(1+1/theta)* (1/gamma(1/theta)) *exp(-log(2)/(theta*h*m)) } med<-seq(1,100) fmed<-sapply(med,calcm) plot(med,fmed,type="l",xlab="Median time",ylab="Density")

Interpretation 

Fitting semiparametric models library(survival) coxph(Surv(timeto,stat)~heifer+frailty(herd)) Call: coxph(formula = Surv(timeto, stat) ~ heifer + frailty(herd)) coef se(coef) se2 Chisq DF p heifer e-08 frailty(herd) e+00 Iterations: 10 outer, 23 Newton-Raphson Variance of random effect= I-likelihood = Degrees of freedom for terms= Likelihood ratio test=281 on 41.9 df, p=0 n= 2579 HR=exp(-0.24)=0.79

Time-varying covariates data Contribtion to the denominator: t ij =10 : 2.29 t ij =55 : 2.61

Fitting Cox models with time-varying covariates (1) #Read data insemtvc<-read.table("c://insemtvc.dat",header=T) #Create four column vectors, four different variables herd<-insemtvc$herd begin<-insemtvc$begin end<-insemtvc$end stat<-insemtvc$stat ureum<-insemtvc$ureum heifer<-insemtvc$heifer library(survival) coxph(Surv(begin,end,stat)~heifer+ureum+frailty(herd))

Fitting Cox models with time-varying covariates (2) Call: coxph(formula = Surv(begin, end, stat) ~ heifer + ureum + frailty(herd)) coef se(coef) se2 Chisq DF p heifer e-07 ureum e-01 frailty(herd) e+00 Iterations: 10 outer, 23 Newton-Raphson Variance of random effect= I-likelihood = Degrees of freedom for terms= Likelihood ratio test=251 on 41.3 df, p=0 n= HR=exp( )=0.997

Fitting Cox models with smoothing splines (1) #Read data insemtvc<-read.table("c://insemtvc.dat",header=T) #Create four column vectors, four different variables herd<-insemtvc$herd begin<-insemtvc$begin end<-insemtvc$end stat<-insemtvc$stat ureum<-insemtvc$ureum heifer<-insemtvc$heifer library(survival) fit<-coxph(Surv(begin,end,stat)~heifer+pspline(ureum,nterm=3,theta=0.5)) temp<-order(ureum) plot(ureum[temp],predict(fit,type='terms')[temp,2],type='l',xlab='Ureum', ylab='Risk score')

Fitting Cox models with smoothing splines (2) Call: coxph(formula = Surv(begin, end, stat) ~ heifer + pspline(ureum, nterm = 3, theta = 0.5)) coef se(coef) se2 Chisq DF p heifer e-07 pspline(ureum, nterm = 3, e-01 pspline(ureum, nterm = 3, e-02 Iterations: 1 outer, 3 Newton-Raphson Theta= 0.5 Degrees of freedom for terms= Likelihood ratio test=30.2 on 3.18 df, p=1.56e-06 n= 23076

Fitting Cox models with smoothing splines (3)

Fitting the shared normal frailty model (1) #Read data insemfix<- read.table("c://docs//onderwijs//frailtymodels//insemfix.dat",header=T) #Create four column vectors, four different variables herd<-insemfix$herd timeto<-insemfix$timeto-min(insemfix$timeto) stat<-insemfix$stat heifer<-insemfix$heifer coxph(Surv(timeto,stat)~heifer+frailty(herd,distribution="gaussian"))

Fitting the shared normal frailty model (2) Call: coxph(formula = Surv(timeto, stat) ~ heifer + frailty(herd, distribution = "gaussian")) coef se(coef) se2 Chisq DF p heifer e-08 frailty(herd, distributio e+00 Iterations: 6 outer, 14 Newton-Raphson Variance of random effect= Degrees of freedom for terms= Likelihood ratio test=276 on 39.5 df, p=0 n= 2579