Description Details Author(s) References Examples
This package calculates the semi-parametric maximum likelihood estimator (MLE) of the effect parameters and the nonparametric hazard constrained to be either increasing, decreasing, unimodal, or u-shaped. We assume that the times are continuous, and allow for right-censoring.
Package: | CPHshape |
Type: | Package |
Version: | 1.0 |
Date: | 2012-03-06 |
License: | GPL (>=2) |
LazyLoad: | yes |
The two main function in the package is
find.shapeCPH: Compute the maximum likelihood estimator of the effect parameters and the nonparametric shape constrained hazard in the proportional hazard model.
The package also provides the function:
find.shapeMLE: Compute the MLE of a nonparametric shape-constrained hazard.
Rihong Hui and Hanna Jankowski <hkj@mathstat.yorku.ca>
Grenander, U. (1956) On the theory of mortality measurement II. Skand. Aktuarietidskr. 39: 125-153.
Hui, R. and Jankowski, H. (2012). Maximum likelihood estimation of a shape-constrained hazard in the proportional hazard model. Technical Report. http://www.math.yorku.ca/~hkj/
Jankowski, H. and Wellner, J. (2007) Nonparametric Estimation of a convex bathtub-shaped hazard function. University of Washington Technical Report no. 521. http://www.stat.washington.edu/tech.reports/
Mykytyn, S. and Santner, T. (1981) Maximum likelihood estimation of the survival function based on censored data under hazard rate assumptions. Comm. Statist. A - Theory and Methods 10 (14): 1369-1387.
Lopuhaa, H.P., Nane, G.F., Shape constrained nonparametric estimators of the baseline distribution in Cox proportional hazards model (2011). Preprint.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # random sample from the proportional hazard model
n <- 200
beta1 <- 1
beta2 <- 2
z1 <- rbinom(n,1,0.5)
z2 <- runif(n,-1,1)
w <- exp(beta1*z1+beta2*z2)
x <- rexp(n, rate=0.3*w)
delta <- 1*(x<=2.5)
x <- pmin(x,2.5)
# compute MLE
mle <- find.shapeCPH(x, cbind(z1,z2) , delta, print=TRUE, type="decreasing")
# estimates of the effect parameter
mle$beta
# plot resulting estimate of baseline hazard
plot(mle)
abline(h=0.3, col="red") # add true baseline
rug(x)
|
iter=i phi[i] |phi[i]-phi[i-1]| beta(s)
0 155.1189 NA 1 1
1 147.6592 7.459727 0.8940756 1.576761
2 147.4062 0.2529715 0.9276278 1.63646
3 147.2954 0.1108208 0.9595456 1.658535
4 147.2418 0.05362574 0.9822369 1.672547
5 147.2155 0.02628741 0.9981048 1.682262
6 147.2025 0.01298339 1.009238 1.689058
7 147.1961 0.006451769 1.017075 1.693838
8 147.1928 0.003219722 1.022605 1.697211
9 147.1912 0.001611591 1.026514 1.699595
10 147.1904 0.0008083586 1.029282 1.701282
11 147.19 0.0004060669 1.031242 1.702478
12 147.1898 0.0002041956 1.032632 1.703325
13 147.1897 0.0001027585 1.033618 1.703926
14 147.1896 5.173894e-05 1.034317 1.704352
15 147.1896 2.606029e-05 1.034814 1.704655
16 147.1896 1.312973e-05 1.035166 1.70487
17 147.1896 6.616276e-06 1.035416 1.705022
[1] 1.035416 1.705022
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.