insight: A Unified Interface to Access Information from Model Objects in R

insight is an R-package (R Core Team, 2019) that fills this important gap by providing a suite of functions to support almost any model (see a list of the many models supported below in the Supported Models section). The goal of insight, then, is to offer tools that provide easy, intuitive, and consistent access to information contained in model objects. These tools aid applied researchers in virtually any field who fit, diagnose, and present statistical models by streamlining access to every aspect of model objects via consistent syntax and output.

insight is an R-package (R Core Team, 2019) that fills this important gap by providing a suite of functions to support almost any model (see a list of the many models supported below in the Supported Models section).The goal of insight, then, is to offer tools that provide easy, intuitive, and consistent access to information contained in model objects.These tools aid applied researchers in virtually any field who fit, diagnose, and present statistical models by streamlining access to every aspect of model objects via consistent syntax and output.
Ultimately, the development of insight is in line with the philosophy of the easystats project, which is to facilitate and streamline the process of statistical analysis, interpreting and reporting the results in the R programming language.

Getting Up and Running with insight
Built with non-programmers in mind, insight offers a broad toolbox for making model and data information easily accessible.While insight offers many useful functions for working with and understanding model objects (discussed below), we suggest users start with model_info(), as this function provides a clean and consistent overview of model objects (e.g., functional form of the model, the model family, link function, number of observations, variables included in the specification, etc.).With a clear understanding of the model introduced, users are able to adapt other insight functions for more nuanced exploration of and interaction with virtually any model object.
Building on this starting place, the remainder of the package revolves around two key prefixes: get_* and find_*.The get_* prefix extracts values (or data) associated with modelspecific objects (e.g., parameters or variables), while the find_* prefix lists model-specific objects (e.g., priors or predictors).These are powerful families of functions allowing for great flexibility in use, whether at a high, descriptive level (find_*) or narrower level of statistical inspection and reporting (get_*).In total, the insight package includes 16 core functions (see Figure 1): get_data(), get _priors(), get_variance(), get_parameters(), get_predictors(), get_random(), get_response(), find_algorithm(), find_formula(), find_variables(), find_term s(), find_parameters(), find_predictors(), find_random(), find_response(), and model_info().In all cases, users must supply at a minimum, the name of the fitted model object.In several functions, there are additional arguments that allow for more targeted returns of model information.For example, the find_variables() function's effects argument allows for the extraction of "fixed effects" terms, "random effects" terms, or by default, "all" terms in the model object.We point users to the package documentation or the complementary package website, https://easystats.github.io/insight/,for a detailed list of the arguments associated with each function as well as the returned values from each function.

Definition of Model Components
The functions from insight address different components of models.In an effort to avoid confusion about specific "targets" of each function, in this section we provide a short explanation of insight's definitions of regression model components (see Figures 2 and 3).For detailed examples, we point users to the accompanying package website.

Data
The dataset used to fit the model.

Parameters
Values estimated or learned from data that capture the relationship between variables.In regression models, these are usually referred to as coefficients.

Response and Predictors
• response: the outcome or response variable (dependent variable) of a regression model.
• predictors: independent variables of (the fixed part of) a regression model.For mixed models, variables that are only in the random effects part (i.e.grouping factors) of the model are not returned as predictors by default.However, these can be included using additional arguments in the function call, treating predictors as "unique".As such, if a variable appears as a fixed effect and a random slope, it is treated as one (the same) predictor.

Variables
Any unique variable names that appear in a regression model, e.g., response variable, predictors or random effects.A "variable" only relates to the unique occurence of a term, or the term name.For instance, the expression x + poly(x, 2) has only the variable x.

Terms
Terms themselves consist of variable and factor names separated by operators, or involve arithmetic expressions.For instance, the expression x + poly(x, 2) has one variable x, but two terms x and poly(x, 2).

Random Effects
• random slopes: variables that are specified as random slopes in a mixed effects model.
• random or grouping factors: variables that are specified as grouping variables in a mixed effects model.

Examples
For a more intuitive introduction, consider the following examples for three major types of models: ordinary least squares (OLS) regression, linear mixed effects models, and Bayesian models.Importantly, though only a few functions are included below for the sake of space, users are encouraged to inspect the package documentation for an exhaustive list of package functionality with accompanying examples.

Licensing and Package Access
insight is licensed under the GNU General Public License (v3.0), with all source code stored at GitHub (https://github.com/easystats/insight),with a corresponding issue tracker for bugreporting and feature enhancements.In the spirit of open science and research, we encourage interaction with our package through requests/tips for fixes, support for additional model objects, feature updates, as well as general questions and concerns via direct interaction with contributors and developers.

Figure 1 :
Figure 1: The functions in insight allow users to access different aspects of models, such as the data used for fitting, the parameters of the fitted model or various information about the model.

Figure 2 :Figure 3 :
Figure 2: Definition of Model Components: Response and Predictors