Refits a model with a specified set of coefficients.
fix.coef(model, beta = NULL)
model | An R model, e.g., produced by |
---|---|
beta | A numeric vector with |
An updated R model object
The function calculates the linear predictor using the new coefficients,
and reformulates the model using the offset
argument. The linear predictor is called
offset
, and its coefficient will be 1
by definition.
The new model only fits the intercept, which should be 0
if we set beta = coef(model)
.
Stef van Buuren, 2018
#> Volume ~ Girth + Height #> <environment: 0x7fe19015e830>#> (Intercept) Girth Height #> -57.9876589 4.7081605 0.3392512#> [1] 421.9214#> Volume ~ 1 #> <environment: 0x7fe19015e830>#> (Intercept) #> 3.988039e-14#> [1] 421.9214#> (Intercept) #> -62.07097#> [1] 1098.984#> [1] 0.94795#> [1] 0.94795#> [1] 0.9228528#> Min. 1st Qu. Median Mean 3rd Qu. Max. #> 57.00 82.00 87.00 92.24 102.25 140.00