Description Usage Arguments Author(s) References See Also Examples
coxre fits a Cox proportional hazards model to event history
data using a gamma distribution random effect. The parameter, gamma,
is the variance of this mixing distribution.
If a matrix of response times is supplied, the model can be stratified by columns, i.e. a different intensity function is fitted for each column. To fit identical intensity functions to all response types, give the times as a vector.
1 2 3 4  | 
response | 
 Vector or matrix of times to events, with one column per type of response (or subunit).  | 
censor | 
 Corresponding vector or matrix of censoring indicators. If NULL all values are set to one.  | 
nest | 
 Vector indicating to which unit each observation belongs.  | 
cov | 
 One covariate  | 
stratified | 
 If TRUE, a model stratified on type of response (the columns of response) is fitted instead of proportional intensities.  | 
cumul | 
 Set to TRUE if response times are from a common origin instead of times to (or between) events.  | 
estimate | 
 Initial estimate of the frailty parameter.  | 
iter | 
 Maximum number of iterations allowed for the inner EM loop.  | 
print.level | 
 
  | 
ndigit | 
 
  | 
gradtol | 
 
  | 
steptol | 
 
  | 
iterlim | 
 
  | 
fscale | 
 
  | 
typsize | 
 
  | 
stepmax | 
 
  | 
D.G. Clayton and J.K. Lindsey
Clayton, D. (1987) The analysis of event history data: a review of progress and outstanding problems. Statistics in Medicine 7: 819-841
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  | # 11 individuals, each with 5 responses
y <- matrix(c(51,36,50,35,42,
	27,20,26,17,27,
	37,22,41,37,30,
	42,36,32,34,27,
	27,18,33,14,29,
	43,32,43,35,40,
	41,22,36,25,38,
	38,21,31,20,16,
	36,23,27,25,28,
	26,31,31,32,36,
	29,20,25,26,25),ncol=5,byrow=TRUE)
# Different intensity functions
coxre(response=y, censor=matrix(rep(1,55),ncol=5), nest=1:11,
	est=0.7, stratified=TRUE)
# Proportional intensity functions for the five responses
coxre(response=y, censor=matrix(rep(1,55),ncol=5), nest=1:11,
	est=0.7, stratified=FALSE)
# Identical intensity functions
coxre(response=as.vector(t(y)), censor=rep(1,55),
	nest=rep(1:11,rep(5,11)), est=0.7)
 | 
Loading required package: rmutil
Attaching package: ‘rmutil’
The following object is masked from ‘package:stats’:
    nobs
The following objects are masked from ‘package:base’:
    as.data.frame, units
Stratified Cox proportional hazards model with gamma frailty
Call:
coxre(response = y, censor = matrix(rep(1, 55), ncol = 5), nest = 1:11, 
    est = 0.7, stratified = TRUE)
-Log likelihood    126.3376 
Degrees of freedom 6 
AIC                175.3376 
Iterations         2 
gamma =       0.7123921 
correlation = 0.3831395 
Regression coefficients:
(Intercept) 
  -2.637733 
Fixed effects:
          1           2           3           4           5           6 
 0.04508930  2.54649734  0.99559248  0.39620871  3.78376536  4.36021345 
          7           8           9          10          11          12 
 2.85155056 15.19457491 32.42712131 11.88733143  0.06512899  1.36010945 
         13          14          15          16          17          18 
 2.33548856  6.33463000  4.35346859  0.93683082 15.19457491 10.99143247 
         19          20          21          22          23          24 
 0.04689287  1.40576796  1.83167247  1.11191216  3.70907366  4.26194753 
         25          26          27          28          29          30 
 2.85238383  3.04049262 16.21356066 13.58552164  0.08373727  0.45336982 
         31          32          33          34          35          36 
 0.58497068  0.87455011  3.22557551  0.98988924  4.96261197 30.40492624 
         37          38          39          40          41          42 
14.31006962  0.07327011  0.15003721  1.66971710  2.50926261  3.30851804 
         43          44          45          46          47 
 5.42073206  1.11455511  6.10344954 16.21356066 47.54932573 
Random effects:
        1         2         3         4         5         6         7         8 
0.1437091 2.3526328 0.4868738 0.4860624 1.6660830 0.2808677 0.7155620 1.5899889 
        9        10        11 
1.3594625 0.9497731 2.0098322 
Cox proportional hazards model with gamma frailty
Call:
coxre(response = y, censor = matrix(rep(1, 55), ncol = 5), nest = 1:11, 
    est = 0.7, stratified = FALSE)
-Log likelihood    163.4521 
Degrees of freedom 21 
AIC                197.4521 
Iterations         2 
gamma =       0.8907635 
correlation = 0.4584099 
Regression coefficients:
(Intercept)       resp2       resp3       resp4       resp5 
 -3.6281678   2.3562336   0.5615743   1.9280003   1.0898560 
Fixed effects:
           1            2            3            4            5            6 
9.386873e-03 6.911260e-02 1.409360e-01 1.504643e-01 2.469569e-01 2.228434e-01 
           7            8            9           10           11           12 
4.998805e-01 2.715448e-01 6.134907e-01 1.156066e+00 2.403159e+00 6.024137e-01 
          13           14           15           16           17           18 
1.299450e+00 7.583284e-01 2.341333e+00 3.007212e+00 1.247655e+00 1.419677e+00 
          19           20           21           22           23           24 
3.146013e+00 8.783661e+00 6.528740e+00 9.615225e+00 4.678915e+00 2.270592e+01 
          25           26           27           28 
4.201789e+01 7.372914e+01 1.491668e+01 2.860966e+02 
Random effects:
        1         2         3         4         5         6         7         8 
0.1251022 2.5491149 0.4698635 0.3752438 2.1178225 0.2330259 0.6809870 1.7961565 
        9        10        11 
1.5594363 0.6223883 2.1557178 
Stratified Cox proportional hazards model with gamma frailty
Call:
coxre(response = as.vector(t(y)), censor = rep(1, 55), nest = rep(1:11, 
    rep(5, 11)), est = 0.7)
-Log likelihood    176.0124 
Degrees of freedom 25 
AIC                206.0124 
Iterations         3 
gamma =       0.4231517 
correlation = 0.2419091 
Regression coefficients:
(Intercept) 
  -2.739641 
Fixed effects:
          1           2           3           4           5           6 
 0.01978612  0.14234482  0.29121447  0.30137738  0.46574270  0.34311332 
          7           8           9          10          11          12 
 0.70527154  0.36418546  0.75025621  1.29501069  2.46833092  0.63532232 
         13          14          15          16          17          18 
 1.33877190  0.77833468  2.41821379  2.89860461  1.10678801  1.24057362 
         19          20          21          22          23          24 
 2.61934616  6.93323077  4.23314623  5.20774598  1.92591174  8.54216858 
         25          26          27          28 
13.86970985 23.59335600  4.22651740 59.17124357 
Random effects:
        1         2         3         4         5         6         7         8 
0.2590148 1.8040818 0.6844730 0.6580569 1.5160417 0.3926501 0.7078798 1.2218770 
        9        10        11 
1.2448293 0.9851468 1.7396023 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.