# Fit the model
model <- glm(exit ~ profit_margin + sales_log + employees_log,
family = binomial,
data = firms)
# Predicted probabilities for observed data
firms$pred_prob <- predict(model, type = "response")
# Predicted probability for a specific scenario
new_firm <- data.frame(
profit_margin = c(0.10, -0.05), # profitable vs loss-making
sales_log = c(10, 10), # same size
employees_log = c(3, 3) # same size
)
predict(model, newdata = new_firm, type = "response")