estimator: Accessor for Model Estimators

View source: R/estimators.R

estimatorR Documentation

Accessor for Model Estimators

Description

This defines a generic estimator function, which can be applied to different multimedia model objects. It creates a unified interface to estimating diverse mediation and outcome model families.

Usage

estimator(object)

estimator(object)

Arguments

object

A model object that we want to estimate.

Value

A function that can be called with formula and data arguments, like

A fitted version of the input model class.

Examples

m <- lm_model()
estimator(m)(mpg ~ hp + wt, data = mtcars)
m <- rf_model()
fit <- estimator(m)(mpg ~ hp + wt, data = mtcars)

multimedia documentation built on Sept. 30, 2024, 9:28 a.m.