| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/joinerml.R |
| 3 |
\name{glance.mjoint} |
| 4 |
\alias{glance.mjoint} |
| 5 |
\title{Glance at a(n) mjoint object} |
| 6 |
\usage{ |
| 7 |
\method{glance}{mjoint}(x, ...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{x}{An \code{mjoint} object returned from \code{\link[joineRML:mjoint]{joineRML::mjoint()}}.} |
| 11 |
|
| 12 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 13 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 14 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 15 |
argument has a default value, the default value will be used. |
| 16 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 17 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 18 |
\itemize{ |
| 19 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 20 |
it will be ignored. |
| 21 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 22 |
will be ignored. |
| 23 |
}} |
| 24 |
} |
| 25 |
\description{ |
| 26 |
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}} |
| 27 |
with exactly one row of model summaries. The summaries are typically |
| 28 |
goodness of fit measures, p-values for hypothesis tests on residuals, |
| 29 |
or model convergence information. |
| 30 |
|
| 31 |
Glance never returns information from the original call to the modeling |
| 32 |
function. This includes the name of the modeling function or any |
| 33 |
arguments passed to the modeling function. |
| 34 |
|
| 35 |
Glance does not calculate summary measures. Rather, it farms out these |
| 36 |
computations to appropriate methods and gathers the results together. |
| 37 |
Sometimes a goodness of fit measure will be undefined. In these cases |
| 38 |
the measure will be reported as \code{NA}. |
| 39 |
|
| 40 |
Glance returns the same number of columns regardless of whether the |
| 41 |
model matrix is rank-deficient or not. If so, entries in columns |
| 42 |
that no longer have a well-defined value are filled in with an \code{NA} |
| 43 |
of the appropriate type. |
| 44 |
} |
| 45 |
\examples{ |
| 46 |
\dontshow{if (rlang::is_installed("joineRML")) withAutoprint(\{ # examplesIf} |
| 47 |
|
| 48 |
# broom only skips running these examples because the example models take a |
| 49 |
# while to generate—they should run just fine, though! |
| 50 |
\dontrun{ |
| 51 |
|
| 52 |
|
| 53 |
# load libraries for models and data |
| 54 |
library(joineRML) |
| 55 |
|
| 56 |
# fit a joint model with bivariate longitudinal outcomes |
| 57 |
data(heart.valve) |
| 58 |
|
| 59 |
hvd <- heart.valve[!is.na(heart.valve$log.grad) & |
| 60 |
!is.na(heart.valve$log.lvmi) & |
| 61 |
heart.valve$num <= 50, ] |
| 62 |
|
| 63 |
fit <- mjoint( |
| 64 |
formLongFixed = list( |
| 65 |
"grad" = log.grad ~ time + sex + hs, |
| 66 |
"lvmi" = log.lvmi ~ time + sex |
| 67 |
), |
| 68 |
formLongRandom = list( |
| 69 |
"grad" = ~ 1 | num, |
| 70 |
"lvmi" = ~ time | num |
| 71 |
), |
| 72 |
formSurv = Surv(fuyrs, status) ~ age, |
| 73 |
data = hvd, |
| 74 |
inits = list("gamma" = c(0.11, 1.51, 0.80)), |
| 75 |
timeVar = "time" |
| 76 |
) |
| 77 |
|
| 78 |
# extract the survival fixed effects |
| 79 |
tidy(fit) |
| 80 |
|
| 81 |
# extract the longitudinal fixed effects |
| 82 |
tidy(fit, component = "longitudinal") |
| 83 |
|
| 84 |
# extract the survival fixed effects with confidence intervals |
| 85 |
tidy(fit, ci = TRUE) |
| 86 |
|
| 87 |
# extract the survival fixed effects with confidence intervals based |
| 88 |
# on bootstrapped standard errors |
| 89 |
bSE <- bootSE(fit, nboot = 5, safe.boot = TRUE) |
| 90 |
tidy(fit, boot_se = bSE, ci = TRUE) |
| 91 |
|
| 92 |
# augment original data with fitted longitudinal values and residuals |
| 93 |
hvd2 <- augment(fit) |
| 94 |
|
| 95 |
# extract model statistics |
| 96 |
glance(fit) |
| 97 |
} |
| 98 |
\dontshow{\}) # examplesIf} |
| 99 |
} |
| 100 |
\seealso{ |
| 101 |
\code{\link[=glance]{glance()}}, \code{\link[joineRML:mjoint]{joineRML::mjoint()}} |
| 102 |
|
| 103 |
Other mjoint tidiers: |
| 104 |
\code{\link{tidy.mjoint}()} |
| 105 |
} |
| 106 |
\concept{mjoint tidiers} |
| 107 |
\value{ |
| 108 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns: |
| 109 |
\item{AIC}{Akaike's Information Criterion for the model.} |
| 110 |
\item{BIC}{Bayesian Information Criterion for the model.} |
| 111 |
\item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.} |
| 112 |
\item{sigma2_j}{The square root of the estimated residual variance for |
| 113 |
the j-th longitudinal process} |
| 114 |
|
| 115 |
} |