This function is meant to be run after `sm_regression` when the regression model is univariate. From each of the weighted models, the coefficient will be saved as a column in the output data frame.

add_coef(x)

Arguments

x

`sm_regression` object

See also

Examples

sm_regression( data = mtcars, method = "lm", formula = mpg ~ am , weighting_var = "hp", newdata = data.frame(hp = c(150, 200)) ) %>% add_coef()
#> # A tibble: 2 x 3 #> hp .model .coef #> <dbl> <list> <dbl> #> 1 150 <S3: lm> 5.35 #> 2 200 <S3: lm> 4.18