Description Usage Arguments Value Author(s) References See Also Examples
This function gives the Nelson-Aalen estimates at time-points specified by the user.
1 2 3 4 |
object |
An object of class |
times |
Time-points at which one wants the estimates |
tr.choice |
A vector of character giving for which transitions one wants estimates. By default, the function will give the Nelson-Aalen estimates for all transitions. |
level |
Level of the pointwise confidence intervals. Default is 0.95. |
var.type |
Variance estimator displayed and used to compute the pointwise confidence intervals. One of "aalen" or "greenwood". Default is "aalen". |
ci.fun |
Which transformation to apply for the confidence intervals. Choices are "linear", "log" or "arcsin". Default is "log". |
... |
Other arguments to predict |
Returns a list named after the possible transitions, e.g. if we define a multistate model with two possible transitions: from state 0 to state 1, and from state 0 to state 2, the returned list will have two parts named "0 1" and "0 2". Each part contains a data.frame with columns:
times |
Time points specified by the user. |
na |
Nelson-Aalen estimates at the specified times. |
var.aalen or var.greenwood |
Depending on what was specified in
|
lower |
Lower bound of the pointwise confidence intervals. |
upper |
Upper bound. |
Arthur Allignol, arthur.allignol@gmail.com
Andersen, P.K., Borgan, O., Gill, R.D. and Keiding, N. (1993). Statistical models based on counting processes. Springer Series in Statistics. New York, NY: Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | data(sir.cont)
# Modification for patients entering and leaving a state
# at the same date
sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ]
for (i in 2:nrow(sir.cont)) {
if (sir.cont$id[i]==sir.cont$id[i-1]) {
if (sir.cont$time[i]==sir.cont$time[i-1]) {
sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5
}
}
}
# Matrix of logical giving the possible transitions
tra <- matrix(ncol=3,nrow=3,FALSE)
tra[1, 2:3] <- TRUE
tra[2, c(1, 3)] <- TRUE
# Computation of the Nelson-Aalen estimates
na <- mvna(sir.cont,c("0","1","2"),tra,"cens")
# Using predict
predict(na,times=c(1,5,10,15))
|
$`0 1`
time na var.aalen lower upper n.risk n.event
1 1 0.02997275 8.166962e-05 0.01659891 0.05412196 367 11
5 5 0.10045818 2.831896e-04 0.07234298 0.13950000 283 3
10 10 0.19365022 7.770252e-04 0.14604643 0.25677045 148 2
15 15 0.25917549 1.319048e-03 0.19693079 0.34109413 106 2
$`0 2`
time na var.aalen lower upper n.risk n.event
1 1 0.0000000 0.000000000 0.0000000 0.0000000 367 0
5 5 0.6235546 0.001870272 0.5443013 0.7143475 283 48
10 10 1.4590061 0.006234131 1.3121786 1.6222631 148 21
15 15 2.1043120 0.011616216 1.9033267 2.3265208 106 15
$`1 0`
time na var.aalen lower upper n.risk n.event
1 1 0.1000000 0.0002631579 0.07276405 0.1374305 380 38
5 5 0.3830045 0.0011586942 0.32177564 0.4558842 285 16
10 10 0.6984301 0.0025564650 0.60604084 0.8049040 194 10
15 15 0.9812933 0.0043966392 0.85957175 1.1202515 129 4
$`1 2`
time na var.aalen lower upper n.risk n.event
1 1 0.00000000 0.0000000000 0.00000000 0.0000000 380 0
5 5 0.07959526 0.0002553912 0.05370131 0.1179749 285 9
10 10 0.20606305 0.0008339679 0.15657028 0.2712008 194 8
15 15 0.33273804 0.0016902982 0.26117263 0.4239135 129 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.