Skip to contents

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.

Usage

lm_model(progress = TRUE)

Arguments

progress

A logical indicating whether to show a progress bar during estimation.

Value

model An object of class model with estimator, predictor, and sampler functions associated wtih a linear model.

See also

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  
#> 
#>