library(car)
# Estimate model
m1 <- lm(prestige ~ education + type, data = Prestige)
# Create fitted values
fitted_df <- expand.grid(education = 6:16, typewc = 1)
# Simulate coefficients
m1_sims <- b_sim(m1, nsim = 1000)
# Find linear systematic component for fitted values
ls <- linear_systematic(b_sims = m1_sims, newdata = fitted_df)
Run the code above in your browser using DataLab