1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/mfx-tidiers.R 3\name{tidy.betamfx} 4\alias{tidy.betamfx} 5\title{Tidy a(n) betamfx object} 6\usage{ 7\method{tidy}{betamfx}(x, conf.int = FALSE, conf.level = 0.95, ...) 8} 9\arguments{ 10\item{x}{A \code{betamfx} object.} 11 12\item{conf.int}{Logical indicating whether or not to include a confidence 13interval in the tidied output. Defaults to \code{FALSE}.} 14 15\item{conf.level}{The confidence level to use for the confidence interval 16if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. 17Defaults to 0.95, which corresponds to a 95 percent confidence interval.} 18 19\item{...}{Additional arguments. Not used. Needed to match generic 20signature only. \strong{Cautionary note:} Misspelled arguments will be 21absorbed in \code{...}, where they will be ignored. If the misspelled 22argument has a default value, the default value will be used. 23For example, if you pass \code{conf.lvel = 0.9}, all computation will 24proceed using \code{conf.level = 0.95}. Additionally, if you pass 25\code{newdata = my_tibble} to an \code{\link[=augment]{augment()}} method that does not 26accept a \code{newdata} argument, it will use the default value for 27the \code{data} argument.} 28} 29\description{ 30Tidy summarizes information about the components of a model. 31A model component might be a single term in a regression, a single 32hypothesis, a cluster, or a class. Exactly what tidy considers to be a 33model component varies across models but is usually self-evident. 34If a model has several distinct types of components, you will need to 35specify which components to return. 36} 37\details{ 38The \code{mfx} package provides methods for calculating marginal effects 39for various generalized linear models (GLMs). Unlike standard linear 40models, estimated model coefficients in a GLM cannot be directly 41interpreted as marginal effects (i.e., the change in the response variable 42predicted after a one unit change in one of the regressors). This is 43because the estimated coefficients are multiplicative, dependent on both 44the link function that was used for the estimation and any other variables 45that were included in the model. When calculating marginal effects, users 46must typically choose whether they want to use i) the average observation 47in the data, or ii) the average of the sample marginal effects. See 48\code{vignette("mfxarticle")} from the \code{mfx} package for more details. 49} 50\examples{ 51\dontrun{ 52library(mfx) 53 54## Simulate some data 55set.seed(12345) 56n = 1000 57x = rnorm(n) 58 59## Beta outcome 60y = rbeta(n, shape1 = plogis(1 + 0.5 * x), shape2 = (abs(0.2*x))) 61## Use Smithson and Verkuilen correction 62y = (y*(n-1)+0.5)/n 63 64d = data.frame(y,x) 65mod_betamfx = betamfx(y ~ x | x, data = d) 66 67tidy(mod_betamfx, conf.int = TRUE) 68 69## Compare with the naive model coefficients of the equivalent betareg call (not run) 70# tidy(betamfx(y ~ x | x, data = d), conf.int = TRUE) 71 72augment(mod_betamfx) 73glance(mod_betamfx) 74} 75} 76\seealso{ 77\code{\link[=tidy.betareg]{tidy.betareg()}}, \code{\link[mfx:betamfx]{mfx::betamfx()}} 78 79Other mfx tidiers: 80\code{\link{augment.betamfx}()}, 81\code{\link{augment.mfx}()}, 82\code{\link{glance.betamfx}()}, 83\code{\link{glance.mfx}()}, 84\code{\link{tidy.mfx}()} 85} 86\concept{mfx tidiers} 87\value{ 88A \code{\link[tibble:tibble]{tibble::tibble()}} with columns: 89 \item{conf.high}{Upper bound on the confidence interval for the estimate.} 90 \item{conf.low}{Lower bound on the confidence interval for the estimate.} 91 \item{estimate}{The estimated value of the regression term.} 92 \item{p.value}{The two-sided p-value associated with the observed statistic.} 93 \item{statistic}{The value of a T-statistic to use in a hypothesis that the regression term is non-zero.} 94 \item{std.error}{The standard error of the regression term.} 95 \item{term}{The name of the regression term.} 96 \item{atmean}{TRUE if the marginal effects were originally calculated as the 97 partial effects for the average observation. If FALSE, then these were 98 instead calculated as average partial effects.} 99 100} 101