Description Usage Arguments Value References See Also Examples
This function calculates positive prediction value (PPV) and negative predictive value (NPV) for time to event data when there are potentially two causes of failure (competing risks). These values can be used to plot the respective curves.
Two different ways of defining cases for these data can be accounted for in the analysis (see 'type' variable below).
1 |
times |
vector of min(time to event, censoring time) for each individual. |
status1 |
vector of indicators specifying that event 1 was the cause of failure (should equal 1 for individuals where event 1 occured) |
status2 |
vector of indicators specifying that event 2 was the cause of failure (should equal 1 for individuals where event 2 occured) |
x |
vector of marker values |
Z |
vector of (discrete) covariate values |
predict.time |
The prediction time to use to calculate the PPV and NPV. Should be a single numeric value. |
type |
Can take on two values. Set type = 1 if case is defined by the event of interest, and controls are all the rest. Set type = 2 if case is defined by stratifying on event type, and controls are those who have not experienced any events. See 'references' for more information on type. |
smooth |
TRUE/FALSE (default). When set to TRUE non-parametric smoothing is used instead of Cox proportional hazards model. Note, when smooth = TRUE, Z is ignored. |
sigma |
Tuning parameter to be set when smooth = TRUE. The default value of sigma = sd(x)/length(x)^1/3 |
A dataframe consisting of v = marker quantiles, PPV, NPV, and Z values.
If type = 1, the names of the data frame are v, PPV, NPV and Z.
If type = 2, we stratify on event type, so we have seperate PPV and NPV values for different events. Thus, the names of the data frame are v, PPV.event1, NPV.event1, PPV.event2, NPV.event2, and Z.
Zheng Y, Cai T, Jin Y, Feng Z. Evaluating prognostic accuracy of biomarkers under competing risk. Biometrics. 2012 Jun;68(2):388-96.
Zheng Y, Cai T, Feng Z, and Stanford J. Semiparametric Models of Time-dependent Predictive Values of Prognostic Biomarkers. Biometrics. 2010, 66: 50-60.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #type 1
data(crdata)
myPPV.type1 <- comprisk.PPV( times = crdata$times,
status1 = crdata$status1,
status2 = crdata$status2,
x = crdata$x,
Z = crdata$Z,
predict.time = 10,
type = 1)
head(myPPV.type1)
#plot
tmp <- myPPV.type1
par(mfrow=c(1,1))
plot(tmp$v[tmp$Z==0], tmp$PPV[tmp$Z==0], type="l",lwd=2, main="Type 1", xlab="v", ylab="PPV", ylim=c(0,1))
lines(tmp$v[tmp$Z==1], tmp$PPV[tmp$Z==1], lty=2, lwd=2)
legend(x="bottomright", c("Z = 0", "Z = 1"), lty=c(1,2))
#add horizontal lines at P( T < predict.time, experienced event of interest | Z)
abline( h = min(tmp$PPV[tmp$Z==1]), lty = 2, lwd = 2)
abline( h = min(tmp$PPV[tmp$Z==0]), lty = 1, lwd = 2)
#type 2
myPPV.type2 <- comprisk.PPV( times = crdata$times,
status1 = crdata$status1,
status2 = crdata$status2,
x = crdata$x,
Z = crdata$Z,
predict.time = 10,
type = 2)
head(myPPV.type2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.