This function creates a summary table for a linear model, including coefficients, standard errors, p-values, and model statistics (e.g., MSE, R-squared). The table is formatted for LaTeX output using the kableExtra package.
model.summary.table(model, caption)
Arguments
model: A linear model object (e.g., output from lm()).
caption: A character string to be used as the caption for the table.
Returns
A LaTeX-formatted table generated by kableExtra::kable().
Examples
# Fit a linear modelmodel <- lm(mpg ~ wt + hp, data = mtcars)# Generate the summary tablemodel.summary.table(model, caption ="Linear Model Summary")