Skip to contents

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)
#> $mpg
#> 
#> Call:
#> f(formula = fmla, data = ..1)
#> 
#> Coefficients:
#> (Intercept)           hp           wt  
#>    37.22727     -0.03177     -3.87783  
#> 
#> 
m <- rf_model()
fit <- estimator(m)(mpg ~ hp + wt, data = mtcars)