if (FALSE) { # requireNamespace("datawizard", quietly = TRUE)
data(efc, package = "ggeffects")
fit <- lm(barthtot ~ c12hour + e42dep, data = efc)
# default print
predict_response(fit, "e42dep")
# surround CI values with parentheses
print(predict_response(fit, "e42dep"), ci_brackets = c("(", ")"))
# you can also use `options(ggeffects_ci_brackets = c("[", "]"))`
# to set this globally
# collapse CI columns into column with predicted values
print(predict_response(fit, "e42dep"), collapse_ci = TRUE)
# include value labels
print(predict_response(fit, "e42dep"), value_labels = TRUE)
# include variable labels in column headers
print(predict_response(fit, "e42dep"), variable_labels = TRUE)
# include value labels and variable labels
print(predict_response(fit, "e42dep"), variable_labels = TRUE, value_labels = TRUE)
data(iris)
m <- lm(Sepal.Length ~ Species * Petal.Length, data = iris)
# default print with subgroups
predict_response(m, c("Petal.Length", "Species"))
# omit name of grouping variable in subgroup table headers
print(predict_response(m, c("Petal.Length", "Species")), group_name = FALSE)
# collapse tables into one
print(predict_response(m, c("Petal.Length", "Species")), collapse_tables = TRUE, n = 3)
# increase number of digits
print(predict_response(fit, "e42dep"), digits = 5)
}
Run the code above in your browser using DataLab