EVOLUTION-MANAGER
Edit File: predict.survreg.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Predicted Values for a 'survreg' Object</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for predict.survreg {survival}"><tr><td>predict.survreg {survival}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Predicted Values for a ‘survreg’ Object </h2> <h3>Description</h3> <p>Predicted values for a <code>survreg</code> object </p> <h3>Usage</h3> <pre> ## S3 method for class 'survreg' predict(object, newdata, type=c("response", "link", "lp", "linear", "terms", "quantile", "uquantile"), se.fit=FALSE, terms=NULL, p=c(0.1, 0.9), na.action=na.pass, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>result of a model fit using the <code>survreg</code> function. </p> </td></tr> <tr valign="top"><td><code>newdata</code></td> <td> <p>data for prediction. If absent predictions are for the subjects used in the original fit. </p> </td></tr> <tr valign="top"><td><code>type</code></td> <td> <p>the type of predicted value. This can be on the original scale of the data (response), the linear predictor (<code>"linear"</code>, with <code>"lp"</code> as an allowed abbreviation), a predicted quantile on the original scale of the data (<code>"quantile"</code>), a quantile on the linear predictor scale (<code>"uquantile"</code>), or the matrix of terms for the linear predictor (<code>"terms"</code>). At this time <code>"link"</code> and linear predictor (<code>"lp"</code>) are identical. </p> </td></tr> <tr valign="top"><td><code>se.fit</code></td> <td> <p>if <code>TRUE</code>, include the standard errors of the prediction in the result. </p> </td></tr> <tr valign="top"><td><code>terms</code></td> <td> <p>subset of terms. The default for residual type <code>"terms"</code> is a matrix with one column for every term (excluding the intercept) in the model. </p> </td></tr> <tr valign="top"><td><code>p</code></td> <td> <p>vector of percentiles. This is used only for quantile predictions. </p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>applies only when the <code>newdata</code> argument is present, and defines the missing value action for the new data. The default is to include all observations.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>for future methods</p> </td></tr> </table> <h3>Value</h3> <p>a vector or matrix of predicted values. </p> <h3>References</h3> <p>Escobar and Meeker (1992). Assessing influence in regression analysis with censored data. <em>Biometrics,</em> 48, 507-528. </p> <h3>See Also</h3> <p><code><a href="survreg.html">survreg</a></code>, <code><a href="residuals.survreg.html">residuals.survreg</a></code> </p> <h3>Examples</h3> <pre> # Draw figure 1 from Escobar and Meeker, 1992. fit <- survreg(Surv(time,status) ~ age + I(age^2), data=stanford2, dist='lognormal') with(stanford2, plot(age, time, xlab='Age', ylab='Days', xlim=c(0,65), ylim=c(.1, 10^5), log='y', type='n')) with(stanford2, points(age, time, pch=c(2,4)[status+1], cex=.7)) pred <- predict(fit, newdata=list(age=1:65), type='quantile', p=c(.1, .5, .9)) matlines(1:65, pred, lty=c(2,1,2), col=1) # Predicted Weibull survival curve for a lung cancer subject with # ECOG score of 2 lfit <- survreg(Surv(time, status) ~ ph.ecog, data=lung) pct <- 1:98/100 # The 100th percentile of predicted survival is at +infinity ptime <- predict(lfit, newdata=data.frame(ph.ecog=2), type='quantile', p=pct, se=TRUE) matplot(cbind(ptime$fit, ptime$fit + 2*ptime$se.fit, ptime$fit - 2*ptime$se.fit)/30.5, 1-pct, xlab="Months", ylab="Survival", type='l', lty=c(1,2,2), col=1) </pre> <hr /><div style="text-align: center;">[Package <em>survival</em> version 2.44-1.1 <a href="00Index.html">Index</a>]</div> </body></html>