Apply a linear model in parallel across each response $y$ in an outcome or mediation model. This is often useful for mediator models with few pretreatment variables, since each input is low-dimensional, even when there are many responses.
Value
model An object of class model
with estimator, predictor, and
sampler functions associated wtih a linear model.
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
#>
#>