zfit {zfit}R Documentation

zfit: Fit Models in a Pipe

Description

Improve the usage of model fitting functions within a piped work flow.

Details

zfit makes it easier to use a piped workflow with functions that don’t have the “correct” order of parameters (the first parameter of the function does not match the object passing through the pipe).

The issue is especially prevalent with model fitting functions, such as when passing and processing a data.frame (or tibble) before passing them to lm() or similar functions. The pipe passes the data object into the first parameter of the function, but the conventional estimation functions expect a formula to be the first parameter.

This package addresses the issue with three functions that make it trivial to construct a pipe-friendly version of any function:

The package also includes ready made wrappers around the most commonly used estimation functions. zlm()and zglm() correspond to lm() and glm(), and zlogit(), zprobit(), and zpoisson(), use glm() to perform logistic or poisson regression within a pipe.

Finally, the package includes the zprint() function, which is intended to simplify the printing of derived results, such as summary(), within the pipe, without affecting the modeling result itself.

See Also


[Package zfit version 0.4.0 Index]