| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/survival-survreg.R |
| 3 |
\name{tidy.survreg} |
| 4 |
\alias{tidy.survreg} |
| 5 |
\alias{survreg_tidiers} |
| 6 |
\title{Tidy a(n) survreg object} |
| 7 |
\usage{ |
| 8 |
\method{tidy}{survreg}(x, conf.level = 0.95, conf.int = FALSE, ...) |
| 9 |
} |
| 10 |
\arguments{ |
| 11 |
\item{x}{An \code{survreg} object returned from \code{\link[survival:survreg]{survival::survreg()}}.} |
| 12 |
|
| 13 |
\item{conf.level}{The confidence level to use for the confidence interval |
| 14 |
if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. |
| 15 |
Defaults to 0.95, which corresponds to a 95 percent confidence interval.} |
| 16 |
|
| 17 |
\item{conf.int}{Logical indicating whether or not to include a confidence |
| 18 |
interval in the tidied output. Defaults to \code{FALSE}.} |
| 19 |
|
| 20 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 21 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 22 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 23 |
argument has a default value, the default value will be used. |
| 24 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 25 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 26 |
\itemize{ |
| 27 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 28 |
it will be ignored. |
| 29 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 30 |
will be ignored. |
| 31 |
}} |
| 32 |
} |
| 33 |
\description{ |
| 34 |
Tidy summarizes information about the components of a model. |
| 35 |
A model component might be a single term in a regression, a single |
| 36 |
hypothesis, a cluster, or a class. Exactly what tidy considers to be a |
| 37 |
model component varies across models but is usually self-evident. |
| 38 |
If a model has several distinct types of components, you will need to |
| 39 |
specify which components to return. |
| 40 |
} |
| 41 |
\examples{ |
| 42 |
\dontshow{if (rlang::is_installed(c("survival", "ggplot2"))) withAutoprint(\{ # examplesIf} |
| 43 |
|
| 44 |
# load libraries for models and data |
| 45 |
library(survival) |
| 46 |
|
| 47 |
# fit model |
| 48 |
sr <- survreg( |
| 49 |
Surv(futime, fustat) ~ ecog.ps + rx, |
| 50 |
ovarian, |
| 51 |
dist = "exponential" |
| 52 |
) |
| 53 |
|
| 54 |
# summarize model fit with tidiers + visualization |
| 55 |
tidy(sr) |
| 56 |
augment(sr, ovarian) |
| 57 |
glance(sr) |
| 58 |
|
| 59 |
# coefficient plot |
| 60 |
td <- tidy(sr, conf.int = TRUE) |
| 61 |
|
| 62 |
library(ggplot2) |
| 63 |
|
| 64 |
ggplot(td, aes(estimate, term)) + |
| 65 |
geom_point() + |
| 66 |
geom_errorbarh(aes(xmin = conf.low, xmax = conf.high), height = 0) + |
| 67 |
geom_vline(xintercept = 0) |
| 68 |
\dontshow{\}) # examplesIf} |
| 69 |
} |
| 70 |
\seealso{ |
| 71 |
\code{\link[=tidy]{tidy()}}, \code{\link[survival:survreg]{survival::survreg()}} |
| 72 |
|
| 73 |
Other survreg tidiers: |
| 74 |
\code{\link{augment.survreg}()}, |
| 75 |
\code{\link{glance.survreg}()} |
| 76 |
|
| 77 |
Other survival tidiers: |
| 78 |
\code{\link{augment.coxph}()}, |
| 79 |
\code{\link{augment.survreg}()}, |
| 80 |
\code{\link{glance.aareg}()}, |
| 81 |
\code{\link{glance.cch}()}, |
| 82 |
\code{\link{glance.coxph}()}, |
| 83 |
\code{\link{glance.pyears}()}, |
| 84 |
\code{\link{glance.survdiff}()}, |
| 85 |
\code{\link{glance.survexp}()}, |
| 86 |
\code{\link{glance.survfit}()}, |
| 87 |
\code{\link{glance.survreg}()}, |
| 88 |
\code{\link{tidy.aareg}()}, |
| 89 |
\code{\link{tidy.cch}()}, |
| 90 |
\code{\link{tidy.coxph}()}, |
| 91 |
\code{\link{tidy.pyears}()}, |
| 92 |
\code{\link{tidy.survdiff}()}, |
| 93 |
\code{\link{tidy.survexp}()}, |
| 94 |
\code{\link{tidy.survfit}()} |
| 95 |
} |
| 96 |
\concept{survival tidiers} |
| 97 |
\concept{survreg tidiers} |
| 98 |
\value{ |
| 99 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with columns: |
| 100 |
\item{conf.high}{Upper bound on the confidence interval for the estimate.} |
| 101 |
\item{conf.low}{Lower bound on the confidence interval for the estimate.} |
| 102 |
\item{estimate}{The estimated value of the regression term.} |
| 103 |
\item{p.value}{The two-sided p-value associated with the observed statistic.} |
| 104 |
\item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.} |
| 105 |
\item{std.error}{The standard error of the regression term.} |
| 106 |
\item{term}{The name of the regression term.} |
| 107 |
|
| 108 |
} |