| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/mfx.R |
| 3 |
\name{glance.mfx} |
| 4 |
\alias{glance.mfx} |
| 5 |
\alias{glance.logitmfx} |
| 6 |
\alias{glance.negbinmfx} |
| 7 |
\alias{glance.poissonmfx} |
| 8 |
\alias{glance.probitmfx} |
| 9 |
\title{Glance at a(n) mfx object} |
| 10 |
\usage{ |
| 11 |
\method{glance}{mfx}(x, ...) |
| 12 |
|
| 13 |
\method{glance}{logitmfx}(x, ...) |
| 14 |
|
| 15 |
\method{glance}{negbinmfx}(x, ...) |
| 16 |
|
| 17 |
\method{glance}{poissonmfx}(x, ...) |
| 18 |
|
| 19 |
\method{glance}{probitmfx}(x, ...) |
| 20 |
} |
| 21 |
\arguments{ |
| 22 |
\item{x}{A \code{logitmfx}, \code{negbinmfx}, \code{poissonmfx}, or \code{probitmfx} object. (Note that \code{betamfx} objects receive their own set of tidiers.)} |
| 23 |
|
| 24 |
\item{...}{Additional arguments. Not used. Needed to match generic |
| 25 |
signature only. \strong{Cautionary note:} Misspelled arguments will be |
| 26 |
absorbed in \code{...}, where they will be ignored. If the misspelled |
| 27 |
argument has a default value, the default value will be used. |
| 28 |
For example, if you pass \code{conf.lvel = 0.9}, all computation will |
| 29 |
proceed using \code{conf.level = 0.95}. Two exceptions here are: |
| 30 |
\itemize{ |
| 31 |
\item \code{tidy()} methods will warn when supplied an \code{exponentiate} argument if |
| 32 |
it will be ignored. |
| 33 |
\item \code{augment()} methods will warn when supplied a \code{newdata} argument if it |
| 34 |
will be ignored. |
| 35 |
}} |
| 36 |
} |
| 37 |
\description{ |
| 38 |
Glance accepts a model object and returns a \code{\link[tibble:tibble]{tibble::tibble()}} |
| 39 |
with exactly one row of model summaries. The summaries are typically |
| 40 |
goodness of fit measures, p-values for hypothesis tests on residuals, |
| 41 |
or model convergence information. |
| 42 |
|
| 43 |
Glance never returns information from the original call to the modeling |
| 44 |
function. This includes the name of the modeling function or any |
| 45 |
arguments passed to the modeling function. |
| 46 |
|
| 47 |
Glance does not calculate summary measures. Rather, it farms out these |
| 48 |
computations to appropriate methods and gathers the results together. |
| 49 |
Sometimes a goodness of fit measure will be undefined. In these cases |
| 50 |
the measure will be reported as \code{NA}. |
| 51 |
|
| 52 |
Glance returns the same number of columns regardless of whether the |
| 53 |
model matrix is rank-deficient or not. If so, entries in columns |
| 54 |
that no longer have a well-defined value are filled in with an \code{NA} |
| 55 |
of the appropriate type. |
| 56 |
} |
| 57 |
\details{ |
| 58 |
This generic glance method wraps \code{\link[=glance.glm]{glance.glm()}} for applicable |
| 59 |
objects from the \code{mfx} package. |
| 60 |
} |
| 61 |
\examples{ |
| 62 |
\dontshow{if (rlang::is_installed("mfx")) withAutoprint(\{ # examplesIf} |
| 63 |
|
| 64 |
# load libraries for models and data |
| 65 |
library(mfx) |
| 66 |
|
| 67 |
# get the marginal effects from a logit regression |
| 68 |
mod_logmfx <- logitmfx(am ~ cyl + hp + wt, atmean = TRUE, data = mtcars) |
| 69 |
|
| 70 |
tidy(mod_logmfx, conf.int = TRUE) |
| 71 |
|
| 72 |
# compare with the naive model coefficients of the same logit call |
| 73 |
tidy( |
| 74 |
glm(am ~ cyl + hp + wt, family = binomial, data = mtcars), |
| 75 |
conf.int = TRUE |
| 76 |
) |
| 77 |
|
| 78 |
augment(mod_logmfx) |
| 79 |
glance(mod_logmfx) |
| 80 |
|
| 81 |
# another example, this time using probit regression |
| 82 |
mod_probmfx <- probitmfx(am ~ cyl + hp + wt, atmean = TRUE, data = mtcars) |
| 83 |
|
| 84 |
tidy(mod_probmfx, conf.int = TRUE) |
| 85 |
augment(mod_probmfx) |
| 86 |
glance(mod_probmfx) |
| 87 |
\dontshow{\}) # examplesIf} |
| 88 |
} |
| 89 |
\seealso{ |
| 90 |
\code{\link[=glance.glm]{glance.glm()}}, \code{\link[mfx:logitmfx]{mfx::logitmfx()}}, \code{\link[mfx:negbinmfx]{mfx::negbinmfx()}}, |
| 91 |
\code{\link[mfx:poissonmfx]{mfx::poissonmfx()}}, \code{\link[mfx:probitmfx]{mfx::probitmfx()}} |
| 92 |
|
| 93 |
Other mfx tidiers: |
| 94 |
\code{\link{augment.betamfx}()}, |
| 95 |
\code{\link{augment.mfx}()}, |
| 96 |
\code{\link{glance.betamfx}()}, |
| 97 |
\code{\link{tidy.betamfx}()}, |
| 98 |
\code{\link{tidy.mfx}()} |
| 99 |
} |
| 100 |
\concept{mfx tidiers} |
| 101 |
\value{ |
| 102 |
A \code{\link[tibble:tibble]{tibble::tibble()}} with exactly one row and columns: |
| 103 |
\item{AIC}{Akaike's Information Criterion for the model.} |
| 104 |
\item{BIC}{Bayesian Information Criterion for the model.} |
| 105 |
\item{deviance}{Deviance of the model.} |
| 106 |
\item{df.null}{Degrees of freedom used by the null model.} |
| 107 |
\item{df.residual}{Residual degrees of freedom.} |
| 108 |
\item{logLik}{The log-likelihood of the model. [stats::logLik()] may be a useful reference.} |
| 109 |
\item{nobs}{Number of observations used.} |
| 110 |
\item{null.deviance}{Deviance of the null model.} |
| 111 |
|
| 112 |
} |