| gcemod-methods | R Documentation |
Methods for objects of class "gcemod" returned by
gcecox, gcefg, and gcecif, and for
the "gce_lunnmcneil" objects returned by lunnmcneil.
## S3 method for class 'gcemod'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'gce_lunnmcneil'
print(x, digits = max(3L, getOption("digits") - 3L), ...)
## S3 method for class 'gcemod'
summary(object, conf.level = object$conf.level, ...)
## S3 method for class 'gcecox'
summary(object, conf.level = object$conf.level, ...)
## S3 method for class 'gcefg'
summary(object, conf.level = object$conf.level, ...)
## S3 method for class 'gcecif'
summary(object, conf.level = object$conf.level, ...)
## S3 method for class 'gce_lunnmcneil'
summary(object, conf.level = object$conf.level, ...)
## S3 method for class 'summary.gcemod'
print(
x,
digits = max(3L, getOption("digits") - 3L),
signif.stars = getOption("show.signif.stars"),
eps = 1e-04,
...
)
## S3 method for class 'gcemod'
coef(object, ...)
## S3 method for class 'gce_lunnmcneil'
coef(object, ...)
## S3 method for class 'summary.gcemod'
coef(object, ...)
## S3 method for class 'gcemod'
vcov(object, ...)
## S3 method for class 'gce_lunnmcneil'
vcov(object, ...)
## S3 method for class 'gcemod'
confint(object, parm, level = 0.95, exponentiate = FALSE, ...)
## S3 method for class 'gce_lunnmcneil'
confint(object, parm, level = 0.95, exponentiate = FALSE, ...)
## S3 method for class 'gcemod'
nobs(object, ...)
## S3 method for class 'gce_lunnmcneil'
nobs(object, ...)
## S3 method for class 'gcemod'
formula(x, ...)
## S3 method for class 'gce_lunnmcneil'
formula(x, ...)
## S3 method for class 'gcemod'
terms(x, ...)
## S3 method for class 'gce_lunnmcneil'
terms(x, ...)
## S3 method for class 'gcemod'
model.frame(formula, ...)
## S3 method for class 'gcemod'
model.matrix(object, ...)
## S3 method for class 'gcemod'
logLik(object, ...)
## S3 method for class 'gcecif'
logLik(object, ...)
## S3 method for class 'gce_lunnmcneil'
logLik(object, ...)
## S3 method for class 'gcemod'
predict(
object,
newdata = NULL,
type = c("lp", "risk", "ratio", "share"),
times = NULL,
...
)
## S3 method for class 'gcecox'
predict(
object,
newdata = NULL,
type = c("lp", "risk", "ratio", "share"),
times = NULL,
...
)
## S3 method for class 'gcefg'
predict(
object,
newdata = NULL,
type = c("lp", "risk", "ratio", "share"),
times = NULL,
...
)
## S3 method for class 'gcecif'
predict(
object,
newdata = NULL,
type = c("lp", "risk", "ratio", "share"),
times = NULL,
...
)
## S3 method for class 'gcemod'
fitted(object, type = c("lp", "risk", "ratio", "share"), ...)
## S3 method for class 'gcemod'
plot(
x,
which = c("riskscore", "omegatime", "alligator", "calibration"),
bins = 5,
ylab = expression(omega^"+"),
...
)
## S3 method for class 'gcefg'
plot(x, ..., ylab = expression(tilde(omega)^"+"))
## S3 method for class 'gcecif'
plot(x, ..., ylab = expression(rho))
x, object |
a fitted model object. |
digits |
number of significant digits to print. |
... |
for |
conf.level |
confidence level of the intervals in the summary (defaults to the level used when fitting). |
signif.stars |
logical; print significance stars. |
eps |
threshold for printing the p-value of the omnibus test: values
below |
parm |
coefficients for which intervals are wanted (names or indices). |
level |
confidence level. |
exponentiate |
logical; return intervals for the ratios
|
formula |
a fitted model object (the argument name is that of the
|
newdata |
optional data frame of new subjects. If omitted, predictions for the fitting data are returned. |
type |
type of prediction; see Prediction. |
times |
time(s) at which |
which |
display to draw: |
bins |
number of quantile groups for |
ylab |
y-axis label for |
The fitting functions return objects of class c("gcecox", "gcemod"),
c("gcefg", "gcemod"), and c("gcecif", "gcemod"). Behaviour
common to the three models is implemented in the methods for the parent
class "gcemod". Where a model needs its own behaviour
(summary, predict, logLik, plot), a method for
the specific class supplies it and calls the parent method through
NextMethod for the common part.
printa short display: the call, the sample and event
counts, and the estimated ratios exp(coef).
summaryreturns an object of class "summary.gcemod"
(or "summary.gce_lunnmcneil") holding the full coefficient table
(estimate, ratio, standard error, Wald z, p-value), the
confidence intervals for the ratios, the omnibus Wald test, and the
baseline quantity of the model (\omega^{+}(t) of the average
subject, or F_1(t), F_2(t), and \rho(t)). Its
print method formats the table with
printCoefmat. coef() applied to the
summary object returns the coefficient table.
coef, vcov, confintthe log ratios (log
\omega^{+} ratios; log \rho ratios for gcecif), their
covariance matrix, and Wald confidence intervals, all on the reported
coefficient scale (per unit, or per SD if the model was fitted with
standardize = TRUE). confint(exponentiate = TRUE) returns
intervals for the ratios.
logLikthe maximized log partial likelihood of the stacked
model for gcecox fits, and the corresponding weighted log
partial pseudo-likelihood for gcefg fits (useful for comparing
nested specifications descriptively; it is not a genuine likelihood).
gcecif is estimated by generalized estimating equations and has
no likelihood, so logLik signals an error.
nobs, formula, terms, model.frame,
model.matrixthe number of subjects and the stored model
specification. update() works through the stored call.
predict, fittedsee below.
plotdispatches to the display functions; see which.
summary returns an object of class "summary.gcemod"
or "summary.gce_lunnmcneil"; coef a named numeric vector
(for a summary object, the coefficient matrix);
vcov a matrix; confint a two-column matrix; logLik
an object of class "logLik"; predict and fitted a
numeric vector (or matrix, for several times); plot a
ggplot object, invisibly. print methods return their
argument invisibly.
predict() rebuilds the design matrix for newdata from the
stored terms, factor levels, and contrasts. type selects:
"lp"the GCE risk score: the linear predictor centered at the covariate means of the fitting data.
"risk"exp(lp), the subject's ratio relative to the
average subject.
"ratio"the absolute predicted ratio: \omega^{+}(t)
for gcecox (the marginal Nelson-Aalen ratio
H_1(t)/H_2(t) times exp(lp)), \tilde\omega^{+}(t)
for gcefg, and \rho(t) for gcecif.
"share"ratio / (1 + ratio): \omega(t), or the
share \pi_1(t) for gcecif.
times defaults to the readout time t of the fit. With several
times a matrix with one column per time is returned. For
gcecif the landmark time is part of the fitted model and cannot be
changed. fitted() is predict() on the fitting data.
data(hn)
fit <- gcecox(Surv(time, status) ~ age + smoker + p16, data = hn, t = 5)
fit # short display
s <- summary(fit) # full table, returned as an object
coef(s) # the coefficient table
print(s, eps = 1e-8) # p-value formatting of the omnibus test
coef(fit); vcov(fit)
confint(fit, exponentiate = TRUE)
logLik(fit); nobs(fit); formula(fit)
head(fitted(fit)) # risk score
predict(fit, hn[1:3, ], type = "ratio", times = c(2, 5))
fit2 <- update(fit, . ~ . - smoker)
plot(fit, which = "riskscore", bins = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.