Q1 Modeling of Survival Data
Now we will explore the relationship between survival and explanatory variables by modeling. In this class, we consider two broad classes of regression models:
• Proportional Hazards (PH) models
λ(t;Z) = λ0(t)Ψ(Z)
Most commonly, we write the second term as:
Ψ(Z) = eβZ
Suppose Z = 1 for treated subjects and Z = 0 for untreated subjects. Then this model says that the hazard is increased by a factor of eβ for treated subjects versus untreated subjects (cβ might be < 1).
This is an example of a semi-parametric model.
• Accelerated Failure Time (AFT) models log(T) = μ + βZ + σw
where w is an “error distribution”. Typically, we place a parametric assumption on w:
– exponential, Weibull, Gamma
– lognormal 1
Covariates:
In general, Z is a vector of covariates of interest. Z may include:
• continuous factors (eg, age, blood pressure),
• discrete factors (gender, marital status),
• possible interactions (age by sex interaction) Discrete Covariates:
Just as in standard linear regression, if we have a discrete covariate A with a levels, then we will need to include (a−1) dummy variables (U1, U2, . . . , Ua) such that Uj = 1 if A = j. Then
λi(t) = λ0(t) exp(β2U2 + β3U3 + • • • + βaUa)
(In the above model, the subgroup with A = 1 or U1 = 1 is the reference group.)
Interactions:
Two factors, A and B, interact if the hazard of death depends on the combination of levels of A and B.
We usually follow the principle of hierarchical models, and only include interactions if all of the corresponding main Why do we call it proportional hazards? Think of the first example, where Z = 1 for treated and Z = 0 for control. Then if we think of λ1(t) as the hazard rate for the treated group, and λ0(t) as the hazard for control, then we can write:
λ1(t) = λ(t;Z = 1) = λ0(t) exp(βZ)
= λ0(t) exp(β)
This implies that the ratio of the two hazards is a constant, φ, which does NOT depend on time, t. In other words, the hazards of the two groups remain proportional over time. φ = λ1(t)λ0(t)
= eβ
φ is referred to as the hazard ratio. What is the interpretation of β here? 5
The Baseline Hazard Function
In the example of comparing two treatment groups, λ0(t) is the hazard rate for the control group.
In general, λ0(t) is called the baseline hazard function, and reflects the underlying hazard for subjects with all covariates
Z1, ...,Zp equal to 0 (i.e., the “reference group”). The general form is:
λ(t;Z) = λ0(t) exp(β1Z1 + β2Z2 + • • • + βpZp)
So when we substitute all of the Zj’s equal to 0, we get:
λ(t,Z = 0) = λ0(t) exp(β1 ∗ 0 + β2 ∗ 0 + • • • + βp ∗ 0)
= λ0(t)
In the general case, we think of the i-th individual having a set of covariates Zi = (Z1i, Z2i, ...,Zpi), and we model their hazard rate as some multiple of the baseline hazard rate:
λi(t,Zi) = λ0(t) exp(β1Z1i + • • • + βpZpi) This means we can write the log of the hazard ratio for the i-th individual to the reference group as: log
λi(t)
λ0(t)
β1Z1i +
β2Z2i +
•
•
•
+
βpZpi
The Cox Proportional Hazards model is a linear model for the log of the hazard ratio. One of the biggest advantages of the framework of the Cox PH model is that we can estimate the parameters β which reflect the effects of treatment and other covariates without having to make any assumptions about the form of λ0(t).
In other words, we don’t have to assume that λ0(t) follows an exponential model, or a Weibull model, or any other particular parametric model.
That’s what makes the model semi-parametric.
Q2 Kaplan-Meier estimate and pointwise bounds:
survfit(formula, conf.int = 0.95, conf.type = "log")
The Kaplan-Meier estimate is a nonparametric maximum likelihood estimate (MLE) of the survival function, S(t). This estimate is a step function with jumps at observed event times, ti. In the mathematics below, it is assumed the ti are ordered: 0 < t1 < t2 < _ _ _ < tD. If the number of individuals with an observed event time ti is di, and the value Yi represents the number of individuals at risk at time ti (where at risk means individuals who die at time ti or later), then the Kaplan-Meier estimate of the survival function and its estimated variance are given by
^ S(t) = (
1 if t < t1 Q ti_t
h
1 di Yi
i
if t1 _ t
bV [ ^ S(t)] = h
^ S(t) i2
^_2S
(t) = h
^ S(t) i2X ti_t di
Yi(Yi di)
The pointwise con_dence bounds for the "plain" (linear) and "log-log" options provided in R are given by
_
^ S Z1_=2^_S(t) ^ S(t); ^ S + Z1_=2^_S(t) ^ S(t)
_
_
^ S1=_(t); ^ S_(t)
_
, where _ = exp (
Z1_=2^_S(t) log ^ S(t)
)
The Kaplan-Meier estimate is _t in R using the function survfit(). The simplest _t takes as input
Q3 (A) The log-normal distribution is another commonly used parametric distribution for characterizing the survival time.
_ LN(μ, σ2) _ expfN(μ, σ2)g
_ E(T) = e_+_2=2
_ Var(T) = e2_+_2 (e_2 1)
(B) Weibull distribution is also a generalization of the simple exponential distribution.
Be careful about the parametrization W(λ, p), λ > 0(scale parameter) and p > 0(shape parameter):
1. S(t) = e−(_t)p
2. f(t) = pλ(λt)p−1e−(_t)p / tp−1e−(_t)p.
3. h(t) = pλ(λt)p−1 / tp−1 4. H(t) = (λt)p.
E(T) = λ−1Γ(1 + 1/p).
Var(T) = λ−2 [ Γ(1 + 2/p) fΓ(1 + 1/p)g2 ]
W(λ, 1) _ EXP(λ).
W(λ, p) _ fEXP(λp)g1=p
Q4 Menu location: Analysis_Survival_Kaplan-Meier.
This function estimates survival rates and hazard from data that may be incomplete.
The survival rate is expressed as the survivor function (S):
- where t is a time period known as the survival time, time to failure or time to event (such as death);
e.g. 5 years in the context of 5 year survival rates. Some texts present S as the estimated probability of surviving to time t for those alive just before t multiplied by the proportion of subjects surviving to t. Thus it reflects the probability of no event before t. At t=0 S(t) = 1 and decreases toward 0 as t increases toward infinity.
The product limit (PL) method of Kaplan and Meier (1958) is used to estimate S:
- where ti is duration of study at point i, di is number of deaths up to point i and ni is number of individuals at risk just prior to ti. S is based upon the probability that an individual survives at the end of a time interval, on the condition that the individual was present at the start of the time interval. S is the product (P) of these conditional probabilities.
If a subject is last followed up at time ti and then leaves the study for any reason (e.g. lost to follow up) ti is counted as their censorship time.
Assumptions:
• Censored individuals have the same prospect of survival as those who continue to be followed. This can not be tested for and can lead to a bias that artificially reduces S.
• Survival prospects are the same for early as for late recruits to the study (can be tested for).
• The event studied (e.g. death) happens at the specified time. Late recording of the event studied will cause artificial inflation of S.
The instantaneous hazard function h(t) [also known as the hazard rate, conditional failure rate or force of mortality] is defined as the event rate at time t conditional on surviving up to or beyond time
t. As h(t) is a rate, not a probability, it has units of 1/t.The cumulative hazard function H_hat (t) is the integral of the hazard rates from time 0 to t,which represents the accumulation of the hazard over time - mathematically this quantifies the number of times you would expect to see the failure event in a given time period, if the event was repeatable. So it is more accurate to think of hazards in terms of rates than probabilities.The cumulative hazard is estimated by the method of Peterson (1977) as:
S and H with their standard errors and confidence intervals can be saved to a workbook for further analysis
Q5 S(t) = Pr(T _ t)
It follows from the de_nition of the survivor function that S(t) = 1 F(t) = Z 1 t f(u)du:
Conditional distribution:
Given an individual lives up to time t0, the distribution of the future survival time is given by: Pr(dies in (t0; t0 + t) j alive at t0) = Pr(T < t0 + t j T _ t0) = F(t0 + t) F(t0) S(t0):
The probability density of future lifetime is the derivative of this:
d dt
F(t0 + t) F(t0) S(t0) = f(t + t0) S(t0):6
Hazard function:
The hazard function at t0, denoted h(t0), is the instantaneous rate of death, i.e. the following limit:
h(t0) = lim
_t!0 1
_t
Pr(die in interval [t0; t0 + _t) j alive at time t0)
The hazard function is related to the survivor function in the following way: h(t0) = lim
_t!0 1
_t
Pr(die in interval [t0; t0 + _t) j alive at time t0)
= lim
_t!0 1
_t
F(t0 + _t) F(t0) S(t0)
= 1
S(t0)
lim
_t!0
F(t0 + _t) F(t0)
_t
= 1
S(t0)
d dt
F(t0) = f(t0)S(t0)
So we have h(t) = f(t)=S(t).
The hazard function gives the following linear approximation Pr(dies in (t0; t0 + _t) j alive at t0) _ _t _ h(t0): 7
Cumulative hazard:
H(t) = R t
0 h(u)du
We have written the hazard function in terms of the survivor function, so now we do the converse { and the cumulative hazard comes in handy. Since S(t) = 1 F(t) it follows that: d
dt log[S(t)] = 1
S(t)
_ d dt
S(t)
= f(t)
S(t)
= h(t): Integrating gives log S(t) = H(t) so
S(t) = exp[H(t)]
Sometimes it's very useful to assume the hazard (or survival) functions have speci_c forms. Of course, this is equivalent to assuming a speci_c form for the underlying probability distribution F of the survival time T. We look next at the simplest assumptions we might make.
Exponential Distribution
Suppose that the hazard function is constant: h(t) = _. It follows that: H(t) = _t
S(t) = exp(_t) f(t) = _ exp(_t):
The probability density function is that for a exponential random variable. It has the `lack of 8 memory property':
Pr(T > t1 + t2 j T > t1) =e_(t1+t2) e_t1= e_t2 = Pr(T > t2):
Weibull Distribution
More usefully, we would like the hazard function to vary with time: the Weibull distribution is the simplest such example. Suppose that h(t) = ctk for some constants c and k > 1.
H(t) = c tk+1
k + 1;
S(t) = exp
_
ck + 1 tk+1
_;
so f(t) = d
dt
F(t) = d
dt S(t)
= ctk exp
_
ck + 1 tk+1
_
:
This is the Weibull distribution. It's more usually written with a di_erent parameterization in the following way. Let = k + 1 and _ = c=(k + 1), ( > 0; _ > 0). Then:
h(t) = _t1 H(t) = _t
S(t) = exp(_t)
f(t) = _t1 exp(_t):
Suppose T is a Weibull random variable with parameters _; . It can be shown that the expectation of T is
E(T) = _1=(1 + 1):
Here is the gamma function:
(x) = Z 1 0
ux1eudu:
Since the distribution is skewed, the median is di_erent from the mean. The median tm is computed as follows:
F(tm) = 1=2
exp(_t m) = 1=2
tm =
_
log 2
_
_1=
:
The 100p-th percentile can be computed in a similar way.
Warning! R uses di_erent parameterizations of the Weibull distribution. If you ever _t a Weibull model in R, make sure you know which parameterization is being used. In the R parameterisation the pdf is f(t) =
_
_ t
_
_1 exp
_
_
t
_
so
_ = _ and _ = _1=; the mean is
E(T) = _(1 + 1) and the median is tm = _(log 2)1=:
Q6 Mortality from prostate cancer increased with tumor stage and grade. For men with stage T1 or T2, low or moderate grade tumors (59.1% of all cases), mortality from prostate cancer was 2.12%, versus a 6.40% mortality rate from heart disease and 3.83% mortality from other cancers.
√s2 + .2
_
→ pr
_
z > −m s
_
(5)
Hence, equation (5) = 1 − {one-sided Phase II p-value}. Consequently, if the Phase III is very large, the chance of success by assurance is maximally 1 minus the one-sided p-value from Phase II. For example, a Phase II with p = 0020 one-sided means that assurance in Phase III cannot exceed 80% even with infinitely many patients entered. More generally, as .2 → 0 then c → 0 and the conventional power curve approaches a step function. Then any observed difference > 0 rejects the null with 100% probability, and any difference ≤ 0 rejects with probability zero. Therefore, for any prior f4.5, assurance R 4power . .5f4.5d. →
+.
0 f4.5d., which is the fraction of the prior density that lies to the right of zero.
(iv) If Phase III is k Times Larger than Phase II More commonly, .2 > 0 and s2 > 0 with .2 ≤ s2. In this circumstance, if the size of the Phase III is k times
(A) exponential approximation, using the survival probability at 36 months. First find the hazard estimate 0 .
(B) We observe that the vector (B(t1), . . . ,B(tn)) has a multivariate normal distribution because the event
{B(t1) = x1, . . . ,B(tn) = xn}
can be re-written in terms of independent increment events (t1) = x1,B(t2) − B(t1) = x2 − x1, . . . ,B(tn) − B(tn−1) = xn − xn},
yielding the joint density of (B(t1), . . . ,B(tn)) f(x1, . . . , xn) = ft1(x1)ft2−t1(x2 − x1) • • • ftn−tn−1(xn),
(C) is the risk ratio that we need to detect with 90% power with a two-sided 5% level test, find the needed number of deaths d . (That is, in the formula, use / 2 0.025.)
(D) In order to construct an error bar for ^ S(t) we need to make some sort of distributional assumption. The simplest is to assume that ^ S(t) is normally distributed. Let z_=2 be such that
Pr(Z > z_=2) = _=2; where Z _ N(0; 1); then an approximate 100(1 _)% interval is given by ^ S(t) _ z_=2s[ ^ S(t)] where s[ ^ S(t)] is the standard error.
A snag with this, of course is that the distribution of ^ S(t) is not really normal. Problems arise when ^ S(t) is close to 0 or 1. One possible solution is to transform ^ S(t) onto a (1;1) scale.
(E) statistical considerations we have r groups of individuals, with r > 2. We're interested in testing whether all the groups are the same ie. the null hypothesis is that all the groups have the same survival distribution. Our approach and notation is the same as previously: we pool all the death times together to de_ne intervals [0; t1); [t1; t2), etc. We then have dkj deaths in group k on interval j and nkj individuals alive and uncensored from group k at the start of interval j. We can extend the simpli_ed form of the log-rank test quite readily.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme