Learn R Programming

multimedia (version 0.2.0)

estimator: 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)

Value

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

A fitted version of the input model class.

Arguments

object

A model object that we want to estimate.

Examples

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

Run the code above in your browser using DataLab