if (FALSE) { # requireNamespace("datawizard", quietly = TRUE)
data(efc, package = "ggeffects")
fit <- lm(barthtot ~ c12hour + neg_c_7 + c161sex + c172code, data = efc)
new_data(fit, c("c12hour [meansd]", "c161sex"))
nd <- new_data(fit, c("c12hour [meansd]", "c161sex"))
pr <- predict(fit, type = "response", newdata = nd)
nd$predicted <- pr
nd
# compare to
predict_response(fit, c("c12hour [meansd]", "c161sex"))
}
Run the code above in your browser using DataLab