Debian Codegraph @

man/tidy.cch.Rd

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