list_fixed_effects | R Documentation |
This function lists the fixed effects coefficients from an 'lmerMod'/'merMod' object, providing the index and name of each coefficient. This can help users construct contrast vectors ('k_list') for use with the 'mixedbiastest' function.
list_fixed_effects(model)
model |
An object of class 'merMod' fitted using 'lmer' from the 'lme4' package. |
A data frame with two columns:
Index
The index of each fixed effect coefficient.
Coefficient
The name of each fixed effect coefficient.
Development of this package was assisted by GPT o1-preview, which helped in constructing the structure of much of the code and the roxygen documentation. The code is based on the R code provided by Karl and Zimmerman (2020).
if (requireNamespace("plm", quietly = TRUE) && requireNamespace("lme4", quietly = TRUE)) {
library(lme4)
data("Gasoline", package = "plm")
# Fit a random effects model using lme4
mixed_model <- lmer(lgaspcar ~ lincomep + lrpmg + lcarpcap + (1 | country),
data = Gasoline, REML = FALSE)
# List fixed effects
fixed_effects <- list_fixed_effects(mixed_model)
print(fixed_effects)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.