EVOLUTION-MANAGER
Edit File: dsurvreg.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: Distributions available in survreg.</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 dsurvreg {survival}"><tr><td>dsurvreg {survival}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Distributions available in survreg. </h2> <h3>Description</h3> <p>Density, cumulative distribution function, quantile function and random generation for the set of distributions supported by the <code>survreg</code> function. </p> <h3>Usage</h3> <pre> dsurvreg(x, mean, scale=1, distribution='weibull', parms) psurvreg(q, mean, scale=1, distribution='weibull', parms) qsurvreg(p, mean, scale=1, distribution='weibull', parms) rsurvreg(n, mean, scale=1, distribution='weibull', parms) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>vector of quantiles. Missing values (<code>NA</code>s) are allowed. </p> </td></tr> <tr valign="top"><td><code>q</code></td> <td> <p>vector of quantiles. Missing values (<code>NA</code>s) are allowed. </p> </td></tr> <tr valign="top"><td><code>p</code></td> <td> <p>vector of probabilities. Missing values (<code>NA</code>s) are allowed. </p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>number of random deviates to produce</p> </td></tr> <tr valign="top"><td><code>mean</code></td> <td> <p>vector of linear predictors for the model. This is replicated to be the same length as <code>p</code>, <code>q</code> or <code>n</code>. </p> </td></tr> <tr valign="top"><td><code>scale</code></td> <td> <p>vector of (positive) scale factors. This is replicated to be the same length as <code>p</code>, <code>q</code> or <code>n</code>. </p> </td></tr> <tr valign="top"><td><code>distribution</code></td> <td> <p>character string giving the name of the distribution. This must be one of the elements of <code>survreg.distributions</code> </p> </td></tr> <tr valign="top"><td><code>parms</code></td> <td> <p>optional parameters, if any, of the distribution. For the t-distribution this is the degrees of freedom. </p> </td></tr> </table> <h3>Details</h3> <p>Elements of <code>q</code> or <code>p</code> that are missing will cause the corresponding elements of the result to be missing. </p> <p>The <code>location</code> and <code>scale</code> values are as they would be for <code>survreg</code>. The label "mean" was an unfortunate choice (made in mimicry of qnorm); since almost none of these distributions are symmetric it will not actually be a mean, but corresponds instead to the linear predictor of a fitted model. Translation to the usual parameterization found in a textbook is not always obvious. For example, the Weibull distribution is fit using the Extreme value distribution along with a log transformation. Letting <i>F(t) = 1 - exp(-(at)^p)</i> be the cumulative distribution of the Weibull using a standard parameterization in terms of <i>a</i> and <i>p</i>, the survreg location corresponds to <i>-log(a)</i> and the scale to <i>1/p</i> (Kalbfleisch and Prentice, section 2.2.2). </p> <h3>Value</h3> <p>density (<code>dsurvreg</code>), probability (<code>psurvreg</code>), quantile (<code>qsurvreg</code>), or for the requested distribution with mean and scale parameters <code>mean</code> and <code>sd</code>. </p> <h3>References</h3> <p>Kalbfleisch, J. D. and Prentice, R. L. (1970). <em>The Statistical Analysis of Failure Time Data</em> Wiley, New York. </p> <h3>See Also</h3> <p><code><a href="survreg.html">survreg</a></code>, <code><a href="../../stats/html/Normal.html">Normal</a></code> </p> <h3>Examples</h3> <pre> # List of distributions available names(survreg.distributions) ## Not run: [1] "extreme" "logistic" "gaussian" "weibull" "exponential" [6] "rayleigh" "loggaussian" "lognormal" "loglogistic" "t" ## End(Not run) # Compare results all.equal(dsurvreg(1:10, 2, 5, dist='lognormal'), dlnorm(1:10, 2, 5)) # Hazard function for a Weibull distribution x <- seq(.1, 3, length=30) haz <- dsurvreg(x, 2, 3)/ (1-psurvreg(x, 2, 3)) ## Not run: plot(x, haz, log='xy', ylab="Hazard") #line with slope (1/scale -1) ## End(Not run) </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>