external_fitters: Pipe-friendly wrappers for external fitters

zlm_robustR Documentation

Pipe-friendly wrappers for external fitters

Description

These functions provide pipe-friendly wrappers around model fitters provided by several external packages. The functions require the corresponding packages to be installed, if the required package is missing the functions warns with directions for how to install it.

zlm_robust() wraps estimatr::lm_robust(), which fits a linear model with a variety of options for estimating robust standard errors.

zpolr() wraps MASS::polr(), which fits an ordered logistic response for multi-value ordinal variables, using a proportional odds logistic regression.

zplsr() wraps pls::plsr(), which performs a partial least squares regression.

Examples

if (requireNamespace("estimatr") && getRversion() >= "4.1.0")
  zlm_robust(cars, dist ~ speed) |> summary() |> try()

if (requireNamespace("MASS") && getRversion() >= "4.1.0")
  zpolr(mtcars, ordered(gear) ~ mpg + hp) |> summary() |> try()

if (requireNamespace("pls") && getRversion() >= "4.1.0")
  zplsr(cars, dist ~ speed) |> summary() |> try()


zfit documentation built on Aug. 27, 2023, 5:06 p.m.