| dvnames | R Documentation |
A convenience function for use with a regression model or list of regression models.
Returns a named list of models, where the names are the models' respective dependent variables.
If the dependent variables are labelled, the labels are used as names.
Pass your list of models to dvnames before sending to modelsummary to automatically get dependent variable-titled columns.
dvnames(models, number = FALSE, strip = FALSE, fill = "Model")
models |
A regression model or list of regression models |
number |
Should the models be numbered (1), (2), etc., in addition to their dependent variable names? |
strip |
Boolean toggle for how dependent variable names are extracted. When strip is |
fill |
If |
m1 <- lm(mpg ~ hp, data = mtcars)
m2 <- lm(mpg ~ hp + wt, data = mtcars)
# Without dvnames, column names are (1) and (2)
modelsummary(list(m1, m2))
# With dvnames, they are "mpg" and "mpg"
modelsummary(dvnames(list(m1,m2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.