Description Usage Arguments Details Value See Also Examples
Give the survival or quantile function from the extreme procedure for the Cox model
1 2 3 4 |
object |
output object of the function cox.adapt. |
newdata |
a data frame with which to predict. |
input |
optionnaly, the name of the variable to estimate. |
type |
either "quantile" or "survival". |
aggregation |
either "none", "simple" or "adaptive". |
AggInd |
Indices of thresholds to be aggregated. |
M |
Number of thresholds to be aggregated. |
... |
further arguments passed to or from other methods. |
newdata must be a data frame with the co-variables from which to predict and a variable of probabilities with its name starting with a "p" if type = "quantile" or a variable of quantiles with its name starting with a "x" if type = "survival". The name of the variable from which to predict can also be written as input.
The function provide the quantile assiociated to the adaptive model for the probability grid if type = "quantile". And the survival function assiociated to the adaptive model for the quantile grid if type = "survival".
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 | library(survival)
data(bladder)
X <- bladder2$stop-bladder2$start
Z <- as.matrix(bladder2[, c(2:4, 8)])
delta <- bladder2$event
ord <- order(X)
X <- X[ord]
Z <- Z[ord,]
delta <- delta[ord]
cph<-coxph(Surv(X, delta) ~ Z)
ca <- cox.adapt(X, cph, delta, bladder2[ord,])
xgrid <- X
newdata <- as.data.frame(cbind(xgrid,bladder2[ord,]))
Plac <- predict(ca, newdata = newdata, type = "survival")
Treat <- predict(ca, newdata = newdata, type = "survival")
PlacSA <- predict(ca, newdata = newdata,
type = "survival", aggregation = "simple", AggInd = c(10,20,30,40))
TreatSA <- predict(ca, newdata = newdata,
type = "survival", aggregation = "simple", AggInd = c(10,20,30,40))
PlacAA <- predict(ca, newdata = newdata,
type = "survival", aggregation = "adaptive", M=10)
TreatAA <- predict(ca, newdata = newdata,
type = "survival", aggregation = "adaptive", M=10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.