tidy.cp_model_nls | R Documentation |
This function extracts model coefficients from a cross-price demand model into a tidy data frame format, following the conventions of the broom package. It handles cases where model fitting failed gracefully, returning an empty data frame with the expected structure.
## S3 method for class 'cp_model_nls'
tidy(x, ...)
x |
A model object from fit_cp_nls or fit_cp_linear |
... |
Additional arguments (unused) |
A data frame with one row per coefficient, containing columns:
term |
The name of the model parameter |
estimate |
The estimated coefficient value |
std.error |
The standard error of the coefficient |
statistic |
The t-statistic for the coefficient |
p.value |
The p-value for the coefficient |
## Not run:
# Fit a cross-price demand model
model <- fit_cp_nls(data, equation = "exponentiated", return_all = TRUE)
# Get coefficients in tidy format
tidy(model)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.