A convenience wrapper around curve_wrap for common model objects.
Automatically selects the appropriate confidence interval method based on the
model class or user specification.
curve_model(model, param, method = "default", steps = 1000,
cores = getOption("mc.cores", 1L), table = TRUE)A fitted model object (lm, glm, nls, lme, etc.)
Character string specifying which parameter to extract.
Method for computing confidence intervals:
Uses confint.default() - Wald/normal approximation (fast)
Uses confint() - profile likelihood (slower, more accurate for GLMs)
Number of consonance levels to compute. Default is 1000.
Number of cores for parallel computation.
Logical. If TRUE (default), includes a summary table.
A list with class "concurve" (see curve_wrap for details).
This is a convenience function that constructs the appropriate ci_func
for curve_wrap based on the specified method. For maximum
flexibility, use curve_wrap directly.
Method selection guidelines:
Linear models (lm): "default" is appropriate and fast
GLMs: "profile" is more accurate, especially for small samples
Mixed models: "profile" recommended but can be slow
Robust models (rlm): "default" typically used
curve_wrap() for the generic wrapper
curve_gen() for the original model-based function
ggcurve() for plotting
if (FALSE) { # \dontrun{
# Linear model - Wald intervals (fast)
model <- lm(mpg ~ wt + hp, data = mtcars)
result <- curve_model(model, param = "wt", method = "default")
ggcurve(result[[1]], type = "c")
# GLM - Profile likelihood intervals (more accurate)
model <- glm(am ~ wt, data = mtcars, family = binomial)
result <- curve_model(model, param = "wt", method = "profile")
# Compare methods
wald <- curve_model(model, param = "wt", method = "default")
profile <- curve_model(model, param = "wt", method = "profile")
# Plot both to see the difference
} # }